
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
make-fetch
Advanced tools
Implement your own fetch()
with node.js streams
npm i --save make-fetch
const makeFetch = require('make-fetch')
const fetch = makeFetch(async (request) => {
const {
url, // String representing request URL
headers, // An object mapping header titles to values
referrer, // An optional string specify the referrer
method, // The HTTP method, will always be uppercase, default is `GET`
body, // An optional async iterable of buffers for the request body
signal // An optional AbortSignal that you might want to listen to for cancellation
} = request
return {
statusCode: 200, // Should specify the status code to send back
headers: { // Optional object mapping response header titles to values
"something": "whatever"
},
data: asyncIterator // Required async iterable for the response body, can be empty
}
})
const response = await fetch('myscheme://whatever/foobar')
console.log(await response.text())
response.body
is an Async Iterable of Buffer objects rather than a WHATWG ReadableStreamFAQs
Implement your own `fetch()` with node.js streams
The npm package make-fetch receives a total of 94 weekly downloads. As such, make-fetch popularity was classified as not popular.
We found that make-fetch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.