Remove std/node, it was merged into Deno itself (#3206)
This used to work, but now it doesn't. Where do you show examples of where this was moved to and how to use it from now on?
12 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
So currently, deno does not have a way to do this without node correct?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I mean, does deno do this directly but also offers a node way to do it?
Or only the node way?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I am referring to these. Does deno have these built in
import { inflate } from "node:zlib";
import { Buffer } from "node:buffer";
Can I find them in API reference? That what I'm asking
Yes they are builtin. Here’re the docs:
https://nodejs.org/api/zlib.html#zlib and https://nodejs.org/api/buffer.html#buffer
You could still import the old std/node if you pin an older version of std. Although the node specifiers will probably work better than std/node in the future.
Change std/node to std@0.177.0/node in your import urls if you want to keep using it from std instead of using the node specifiers.
Ok. I don't like NODE. I will never use if I don't have to. Now that you know this, can you answer me if deno has these 2 libraries as pure deno code. not polyfil node code
Hope I made sense this time
No node. Imagine node doesn't exist right now and answer my question
https://deno.land/x/compress@v0.4.5/zlib/mod.ts?s=inflate
You could use this
Yes, Deno doesn't depend on node. Deno had a polyfil for node in std but they moved that polyfil to core so that they could make it more efficient. The latest blog post has more details. But yes, Deno doesn't use node and you don't need to use Deno's polyfils for node. They exist to make it possible to use npm modules within deno projects and to make it easier to migrate existing node projects over to using deno instead. Having most npm modules available to deno developers will help improve adoption of deno since it will make it easier for people to use popular npm packages like React in Deno. And hopefully the node polyfils/package.json support will lead to more people leaving node for the deno ecosystem instead of people just using deno for new projects.
So in my opinion, node and npm specifiers will improve the deno ecosystem and help bring more people into it.
Thank you!