

























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.
Yes, it’s holiday season and no one can be bothered to do anything, so we’re making participation as streamlined as possible:
const module = require("module");
with
import module from "module";
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" ] }
deno run -A $FILE
$FILE is whichever file you would use in the command node $FILE.
And that’s it! Have a cup of cocoa and cozy up by the fire.
--unstable-bare-node-builtins:
supported as of 1.30, this flag allows you to
import Node.js built-in modules
without a node: 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,
assumes index.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 for
Object.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:
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.
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.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。