D
Deno

help

Remove std/node, it was merged into Deno itself (#3206)

BBairdy2/25/2023
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?
import { inflate } from "https://deno.land/std/node/zlib.ts";
import { Buffer } from "https://deno.land/std/node/buffer.ts";

const input = "789cb3b1d10fa92c48d5f72bcd4d4a2d72cb2fca4d2cd10fd5482e55482bd1d4775630d477016237178592a2d254fde0600d4d3b3b00bae60fb4";
const buffer = Buffer.from(input, "hex");

inflate(buffer, (err, result) => {
if (err) {
console.error(err);
return;
}
console.log(result.toString());
});
import { inflate } from "https://deno.land/std/node/zlib.ts";
import { Buffer } from "https://deno.land/std/node/buffer.ts";

const input = "789cb3b1d10fa92c48d5f72bcd4d4a2d72cb2fca4d2cd10fd5482e55482bd1d4775630d477016237178592a2d254fde0600d4d3b3b00bae60fb4";
const buffer = Buffer.from(input, "hex");

inflate(buffer, (err, result) => {
if (err) {
console.error(err);
return;
}
console.log(result.toString());
});
UUUnknown User2/25/2023
2 Messages Not Public
Sign In & Join Server To View
BBairdy2/25/2023
So currently, deno does not have a way to do this without node correct?
UUUnknown User2/25/2023
2 Messages Not Public
Sign In & Join Server To View
BBairdy2/25/2023
I mean, does deno do this directly but also offers a node way to do it? Or only the node way?
UUUnknown User2/25/2023
Message Not Public
Sign In & Join Server To View
BBairdy2/25/2023
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
Kkylejune2/25/2023
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.
BBairdy2/25/2023
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
UUUnknown User2/25/2023
2 Messages Not Public
Sign In & Join Server To View
Kkylejune2/25/2023
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.
BBairdy2/25/2023
Thank you!

Looking for more? Join the community!

Recommended Posts
FFI Difference between buffer and pointerI’ve been using interchangeably `Deno.UnsafePointer.of(new Uint8Array())` with type `pointer` and `nDetecting invalid JS stringsIs there any built-in way to "detect" invalid strings? Here's an example: ```ts // this is an invaError connecting to MongoDB AtlasHello, I'm trying to connect to MongoDB Atlas via `mongoose` (`npm:mongoose`) but encountered the fointeract with deno Extension at runtimeIs there any way to interact with an extension at code execution? I need to pass a pointer from my rAny good way to modify remote url file and debug it?For example, I'm using `import server "https://deno.land/x/ultra@v2.1.7/server.ts"` I want to modifyCache related headers not included in deno deploy for static file servingI have a hello world level static site using `serveDir`. When I run the site locally I see that WeakError with relativ import path after "deno install"Is it possible that imports in deno.json are ignored after "deno install"? ```bash deno run ./my-Run examples on WindowsAnyone know how to run the `Piping to files` example on Windows? https://deno.land/manual@v1.30.3/exPython alternative to ctypes, can't figure how to convert a codeHello, I am trying to convert a Python ctypes code to Deno using FFI, but can't know why its not woSuggestions for minimal JSX rendering?Any suggestions for rendering jsx to a string (or ideally a stream), in the most minimal manner fromDeno.run Strange IssueI use `Deno.run` + stdout/signals/etc a lot, but this behavior is beyond my current debugging abilitProperly continuously read data from a ReaderWhat's the proper way to continuously read from a `Deno.Reader`? I'm trying to parse incoming HTTP2npm:redis – everything returns `string`?Every command I try to use from `npm:redis` seems to have inferred return type `string`. Look at theMy magic middlewares typeIf anyone wants a typescript challange here is one: I am trying to create a tuple type which containRead one byte at a time from ReadableStreamWhat would be the most obvious way to read a single byte from a ReadableStream at a time?My deno.lock file exceeds 4000 lines of JSON nowIs this common for application projects? Is there any nice way to clean it up?importing packages breaks typesIm importing `Receiver` from https://deno.land/x/upstash_qstash@v0.3.2. but as soon as i import thisBug report: deno.land website returns a 500 error for JS filesOn https://deno.land, I noticed that the Node vs Deno comparison didn't seem to do anything. From Deno stopps at file.read()I am currently working on a way to communicate with a COM device. I can successfully open and read f[Resolved][Fresh] How to load data asynchronously after rendering a page ?Hi ! I was wondering if someone could help me understand the paradigm to load data asynchronously af