You don't need Node to use NPM packages
Key Takeaways
The video demonstrates how to use Node.js packages in the Deno JavaScript runtime with its new NPM specifier, allowing for the use of packages like Express.js without the need for Node.js.
Full Transcript
when Dino came out it blew people's minds and they called it the node killer thanks to its out of the box typescript support and URL based package manager it Embraces es modules and other web standard apis but that's a bit of a problem because it means you can't use all your favorite npm packages in Dino then out of nowhere bun came along another high performance JavaScript runtime with out of the box typescript but also support for all your favorite npm packages they called it the dino killer but this dinosaur would not go extinct without a fight and just a few weeks ago Dino announced support for npm which is a huge deal because I think that was the main deal breaker for people not using Dino in the first place let's check it out to see if it's any good first make sure you have version 1.28 installed or later and if not run Dino upgrade from there create a main.ts file and make sure you have the dino vs code extension installed and then go to the command palette and initialize the workspace now let's imagine we want to use a node package like express.js we can do that by importing it just like a regular yes module but prefixed with this npm specifier and you can also optionally specify by a version number here as well what's cool about this is that there is no npm install required no package Json file and no node modules folder it's way cleaner let's now go ahead and build a basic Express API that has a git endpoint and listens to the port of your choice now let's go ahead and run it with the Dino Run command the first time it runs you'll notice how it downloads the dependencies in the background this might take a while on the first run but it'll be cached for future use now before the code actually executes it will prompt you to allow a bunch of different permissions which prevents Shady packages from doing things they're not supposed to like mine Dogecoin in the background we know Express is legit so we can use the allow all flag to bypass this process and now we're running Express in Dino that's pretty cool but there is one problem Express is written in pure JavaScript and Dino doesn't have access to its typescript types which means we don't get any intellisense in the IDE we can fix that by adding this Dino types directive to the top that points to the type definitions for Express and now we get this beautiful intellisense keep in mind though this step is only required for packages that don't ship their own type type definitions now the other cool thing about Dino and npm is that we can also run commands like those you would run with npx normally a few months ago I built a CLI with node which you can run with npx fire quiz now we can also run it on Dino with Dino Run npm colon fire quiz this is huge because it means we can run virtually any CLI tool like Veet from Dino without ever having to touch node.js itself now while it's definitely awesome to have npm support here there are some caveats like it doesn't currently work with the compile command which you'd want to use to create a self-contained executable for other Platforms in addition there are many npm packages out there that may not be compatible as a result of node's non-standard module system but then again we are still in JavaScript world where you should never expect anything to work exactly as promised thanks for watching and I will see you in the next one
Original Description
Learn how to use Node.js packages in the Deno JavaScript runtime with its new NPM specifier.
#typescript #nodejs #javascript
Deno NPM support blog post https://deno.com/blog/v1.28
Fireship CLI Tutorial https://youtu.be/_oHByo8tiEY
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Beyond Fireship · Beyond Fireship · 20 of 42
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
▶
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Social Media Style Number Formatting in JS
Beyond Fireship
I used 3 different File System APIs in Node.js
Beyond Fireship
Time is Relative, even in JavaScript
Beyond Fireship
How to NOT Screw Up Firebase Environment Variables
Beyond Fireship
How to make your JavaScript Bundle Smaller
Beyond Fireship
Subtle, yet Beautiful Scroll Animations
Beyond Fireship
Beyond Surreal? A closer look at NewSQL Relational Data
Beyond Fireship
How to Build a Discord Bot
Beyond Fireship
How to make Eyeballs that Follow You Around
Beyond Fireship
Reverse Engineer Google’s NASA Dart Easter Egg with CSS
Beyond Fireship
Generate Images Programmatically on the Edge
Beyond Fireship
WTF are all these config files for?
Beyond Fireship
NEW Firebase Features Just Dropped
Beyond Fireship
Next.js 13 - The Basics
Beyond Fireship
Make Crazy Art with the NEW OpenAI Dall-e API
Beyond Fireship
How to Setup Node.js with TypeScript in 2023
Beyond Fireship
Dramatically improve website speed with Partytown
Beyond Fireship
The easiest realtime app I’ve ever built
Beyond Fireship
10 Rendering Patterns for Web Apps
Beyond Fireship
You don't need Node to use NPM packages
Beyond Fireship
Sorting Algorithms Explained Visually
Beyond Fireship
ChatGPT Official API First Look
Beyond Fireship
I built an image search engine
Beyond Fireship
Industrial-scale Web Scraping with AI & Proxy Networks
Beyond Fireship
Next.js Server Actions... 5 awesome things you can do
Beyond Fireship
The ultimate guide to web performance
Beyond Fireship
I built a fullstack PaLM AI app in just 2 minutes
Beyond Fireship
I tried 8 different Postgres ORMs
Fireship
I built a *streaming* AI chat app
Fireship
React VS Svelte...10 Examples
Fireship
How GitHub Actions 10x my productivity
Fireship
PROOF JavaScript is a Multi-Threaded language
Fireship
Mind-blowing page animations are easy now... View Transitions API first look
Fireship
I built an Apple Vision Pro app... visionOS tutorial
Fireship
This UI component library is mind-blowing
Fireship
How I deploy serverless containers for free
Fireship
GitHub Copilot now controls your command line...
Fireship
Build better payment forms using new “embedded” Stripe Checkout
Fireship
Does Deno 2 really uncomplicate JavaScript?
Fireship
JavaScript performance is weird... Write scientifically faster code with benchmarking
Fireship
Is Next.js 15 any good? "use cache" API first look
Beyond Fireship
I built a DeepSeek R1 powered VS Code extension…
Fireship
Related Reads
📰
📰
📰
📰
Trying Declarative Partial Updates: A Future API for Replacing HTML Later
Dev.to · nyaomaru
Debugging React: From Taking a Deep Breath to Finding the Root Cause
Dev.to · surajrkhonde
Next.js vs Remix vs SvelteKit: Which Framework Should You Learn?
Dev.to · Etrit Neziri
Had my Frontend Developer interview with Capgemini (Application Developer) today, and I wanted to…
Medium · JavaScript
🎓
Tutor Explanation
DeepCamp AI