-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new Response()
does not accept Node.js stream
#21063
Comments
I can also confirm that this also happens when inside the Node.js compat layer. So if an jcbhmr@PIG-2016:~/Documents/deno-response-test$ tree -a
.
├── deno.json
├── deno.lock
├── main.ts
├── main_test.ts
├── node_modules
│ ├── .deno
│ │ ├── .deno.lock
│ │ ├── .deno.lock.poll
│ │ ├── .setup-cache.bin
│ │ ├── nocode@1.0.0
│ │ │ ├── .initialized
│ │ │ └── node_modules
│ │ │ └── nocode
│ │ │ ├── nocode.js
│ │ │ └── package.json
│ │ └── node_modules
│ ├── .package-lock.json
│ └── nocode -> /home/jcbhmr/Documents/deno-response-test/node_modules/.deno/nocode@1.0.0/node_modules/nocode
├── package-lock.json
└── package.json
7 directories, 13 files manually edited the nocode.js file outside of deno's knowledge like this: jcbhmr@PIG-2016:~/Documents/deno-response-test$ cat node_modules/.deno/nocode@1.0.0/node_modules/nocode/nocode.js
new Response(process.stdin).text().then(console.log) jcbhmr@PIG-2016:~/Documents/deno-response-test$ echo hi | deno run main.ts
[object Object] |
Node is spec incompatible here and supports a behavior that is not standard. You can do |
Node.js's |
Would this be possible to do only in |
The
Response
constructor is a very easy way to convert a stream to text via.text()
or JSON via.json()
. The following behaviour seems to differ in Node.js and Deno:Node.js:
Deno:
The text was updated successfully, but these errors were encountered: