The Deno team recently shipped Deno by example:
Deno by example is a collection of annotated examples for how to use Deno, and the various features it provides.
It’s a pretty neat little reference.
For example, look at the recommendations for doing input prompts: it’s the
In other words: are you building a CLI tool and need to capture some input from the user? No need to find, vet, install, and learn some third-party input library. Use what you know.
const name = prompt("Please enter your name:"); console.log("Name:", name);
Continuing on the theme of a CLI tool, what if you need to log some output with a dash of style, like colors or font styles? Again, no need to find, vet, install, and learn a third-party library. You can log and style CLI output the same way you do it in the browser’s developer tools: using what you know with
console.log("%cHello World", "color: red");
The point is: You Might Not Need NPM™. Deno strives to mimic web platform APIs wherever possible. Commands like
console.log are available as globals in Deno (while non-standard web APIs you’ll find under the
It reminds me of Ryan Florence’s article where he touts one of the benefits of Remix is that you learn the web platform as you learn Remix. It’s not all proprietary framework knowledge that will one day go extinct.
When you learn how to handle requests and send responses in Remix, you're actually learning the Web Fetch API that's in the browser already…This knowledge transfers!
So you can:
- Learn the tool and, in the process, learn the platform.
- Or, learn the tool and, in the process, learn nothing else — when the tool fades, so does your knowledge.
This is what I love about Deno: always bet on the web.