Run a Node project with Deno and win prizes in the #NodeToDenoChallenge
UPDATE 2024/01/04: The challenge is over! Thanks everyone who participated. Read the results here.
It has been a busy year in Deno land. We launched Deno KV, Deno Queues, Deno Cron, Deno Subhosting, SaaSKit, shipped six minor updates to Fresh, 10 minor updates to the Deno CLI… the list goes on.
One of our biggest initiatives this year is improving Node and npm
compatibility. The npm registry, the largest open source registry in the world,
has many useful modules, and we want you to use them in Deno. Since introducing
npm:
specifiers in Deno 1.28, weâve added
built-in support for Node modules via node:
specifiers,
the ability to
bring your own node modules,
not to mention ongoing polyfills and improvements.
To encourage everyone to try Deno in their Node projects, weâre kicking off the #NodeToDenoChallenge.
Starting today until January 4th, run Deno in any of your Node projects,
screenshot the output (success or failure), and tweet* it with the hashtag
#NodeToDenoChallenge
. Weâll pick 10 random participants and the individual who
tried running Deno on the largest Node project by lines of code, and reward them
with $100 gift card to the Deno merch store.
*And if youâre not on Twitter, you can still participate! Just paste your success or error output in GitHub issues or on Mastodon. As long as we can find it.
How to participate
Yes, itâs holiday season and no one can be bothered to do anything, so weâre making participation as streamlined as possible:
- Take any Node project. Doesnât need to be an app or a server. Can be a script even.
- If necessary, update import statements to ESM. This means replacing
const module = require("module");
with
import module from "module";
- Add the below
deno.json
file, which enables various unstable Node/npm compatibility settings, to the root of your project.
{
"unstable": [
"bare-node-builtins",
"byonm",
"sloppy-imports",
"unsafe-proto"
]
}
- Run this command:
- Take a screenshot of the output, regardless of success or failure.
- Share it on Twitter or create a GitHub issue. (If you want to be eligible for the “largest Node project” category, then you must also include a link to the GitHub so we can verify lines of code.)
And thatâs it! Have a cup of cocoa and cozy up by the fire.
What are all these unstable Node compatibility settings?
--unstable-bare-node-builtins
: supported as of 1.30, this flag allows you to import Node.js built-in modules without anode:
specifier.--unstable-byonm
: The “bring your own node_modules” feature, supported as of 1.38, allows you to use Deno with the npm package manager of your choice.--unstable-sloppy-imports
: supported as of 1.39, which loosens the requirements for how Deno imports modules (e.g. import statements donât need file extensions, assumesindex.js
, etc). Note this is not recommended for general use. For more details, check out the PR.--unstable-unsafe-proto
: also supported as of 1.39, this flag enables support forObject.prototype.__proto__
, which many npm packages rely on to function properly. Again, this is not recommended for general use for security reasons.
For additional info on Node/npm interoperability with Deno, check out these resources:
Prizes
On January 4th, 10 randomly selected participants will win a $100 gift card to the Deno merch store. Multiple submissions do not increase the chances of being selected.
Additionally, the submission that attempted to run Deno on the largest Node project by lines of code is guaranteed to win a $100 gift card. (Note that in order to be eligible for this prize, you must share a link to the GitHub project for us to verify lines of code.)
Finally, to encourage everyone to get the word out and share it with your circles, if we get more than 100 unique submissions, we’ll raise the gift card prize from $100 to $200.
We’ll keep track of the total number of submissions in our Discord.
Results
We’ve received a total of 47 submissions, ranging from utility libraries
like node-cbor
and
node-gamedig, scaffolding and build
tools like create-react-app
and
create-vite
,
a VSCode extension manager, personal
websites, apps, and bots, and more.
The largest Node project (by lines of JavaScript/TypeScript) submitted was
kibana
with 3,212,395 lines. The
submission also
included a step-by-step walkthrough of their attempt,
such as modifying require
statements, the set of enabled Deno flags, and
removing some Node version validation. Congratulations to
hverlin
for winning the Largest Node Project
prize.
Thank you everyone for participating and helping us improve our Node compatibility. If you were one of the 10 randomly selected, the Deno tam will contact you on Twitter, Discord, or email with prize information.