undici
node-fetch
Our great sponsors
undici | node-fetch | |
---|---|---|
18 | 90 | |
5,664 | 8,622 | |
3.3% | 0.4% | |
9.8 | 1.7 | |
4 days ago | 23 days ago | |
JavaScript | JavaScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
undici
-
When LIMIT 9 works but LIMIT 10 hangs: A short debugging story
Yeah: interestingly, they had a test for the biggest category of frame, but not for the two other categories: https://github.com/nodejs/undici/blob/main/test/websocket/se...
The test I contributed is very specific to the frame fix I made, but I should probably go back and contribute more tests in send.js that test other lengths too.
-
Is native fetch in v18 faster than dedicated libraries?
The native fetch in Node.js 18 is based on undici.
-
Are all fetch API's for Nodejs inefficient in terms of latency ? Cant go lower than 4ms on localhost
Did you try just using the http lib, or even axios/node-fetch? The fetch API in node is very new and looks like there have been concerns about its performance: https://github.com/nodejs/undici/issues/1203
-
Pull Congressional Data via SMS with the Congress API and JavaScript
Afterwards, create your new project and install our lone requirement [undici](https://github.com/nodejs/undici) to make HTTP requests in Node.js by running:
-
Deno 1.20
> ...enough insights of how much better/faster Deno is
We moved our Deno project to Node because of lack of lower-level APIs on their Conn interfaces [0][1], but otherwise for our use-case (lots of tiny HTTPS connections) Deno absolutely blew Node out-of-the-water. Even at p50 (100tps) Deno (v1.18) was 10x faster than Node (v17.x) [2]
RAM wise, I found Deno (v1.18+) use 10M or so higher for the same code-base.
[0] https://github.com/denoland/deno/issues/13636
[1] https://github.com/denoland/deno/issues/9109
[2] https://github.com/nodejs/undici/issues/1203#issuecomment-10...
-
Fetch API has landed into Node.js
https://github.com/nodejs/undici/blob/2dd3437e20c5a3cc466226...
I've argued with the authors of the fetch spec about this before, and ultimately settled on using https://www.npmjs.com/package/set-cookie-parser#user-content... to work around this flaw. (For clarity, I published the package, but chrusart wrote that method - https://github.com/nfriedly/set-cookie-parser/pull/19)
In undici this will fail with res.status 0, as per spec. You aren't allowed to see the content of a redirect, like in a browser.
Is that URL incorrect? Should it be https://github.com/nodejs/undici ?
The commit adds undici (another Node.js project at https://github.com/nodejs/undici ) as a dependency and exposes its `fetch` - the code changes you see are probably just adding a flag :)
> I just wonder how come features like this that kind of seems obvious to include in the ecosystem takes quite some time to land?
I answered that below (check it out) but note how expensive adding a bad API is vs. asking people for one more `npm install` :) There is more discussion in https://github.com/nodejs/node/issues/19393 and in https://docs.google.com/document/d/1tn_-0S_FG_sla81wFohi8Sc8... a discussion from 2018 we had on it
-
NodeSecure - The future
Rewriting SlimIO/npm-registry from zero in the org (with undici as http client).
node-fetch
-
OAuth 2.0 implementation in Node.js
Note: In case you run into install reference error: fetch isn’t defined, ensure you install node-fetch
-
5 Ways to Make HTTP Requests in Node.js
Node Fetch is a JavaScript library tailored for Node.js that simplifies making HTTP requests. It offers a straightforward and Promise-based approach for fetching resources from the internet or server, such as GET, POST, PUT, and DELETE requests. Designed for server-side applications, it's compatible with the Fetch API, allowing easy code transition between client-side and server-side environments.
-
CommonJS Is Hurting JavaScript
Would anyone be interested in an article about the crusade to move JS to ESM? I've been considering writing one, here's a preview:
Sindresorus wrote a gist "Pure ESM modules"[0] and converted all his modules to Pure ESM, breaking anyone `require`ing his code; he later locked the thread to prevent people from complaining. node-fetch released a pure ESM version a year ago that is 16x less popular than the CommonJS version[1]. The results of these changes broke a lot of code and resulted in many hours of developers figuring out how make their projects compatible with Pure ESM modules (or decide to ignore them and use old CommonJS versions)--not to mention the tons of pointless drama on GitHub issues.
Meanwhile, TC-39 member Matteo Collima advocated a moderate approach dependent on where your module will be run [2]. So the crusade is led not by the Church, but by a handful of zealots dedicated to establishing ESM supremacy for unclear reasons (note how Sindresorus' gist lacks any justifications). It's kind of like the Python 2 to 3 move except with even less rationale and not driven by the core devs.
0 - https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3...
1 - https://www.npmjs.com/package/node-fetch?activeTab=versions
2 - https://github.com/nodejs/node/issues/33954#issuecomment-924...
-
Next-Level Technical Blogging with Dev.to API
The API is CORS-enabled, meaning you’ll have to use the getArticles() functions from your backend. For making the actual request, you can use the fetch() function, available since Node.js v18. For older versions of Node.js, you can use a fetch()-compatible library like node-fetch.
-
How to Parse RSS Feed in Javascript
The RSS feed's URL will then need to be requested over the network. The native fetch API of JavaScript will be used since it is the most efficient. It undoubtedly works in browsers, and it appears that Node has a pretty well-liked implementation of it.
-
Exploring the Most Commonly Used Folder Names in Popular NPM Packages
docs: Documentation is an essential part of any package, as it provides users with the information they need to understand how to use it and how it works. The documentation usually includes usage instructions, API documentation, and more. It can also be included directly in the repository's README.md file, but it's often split into multiple files and stored in this folder for ease of navigation and maintenance. Although the documentation files can be in any format, the most common one is Markdown. Example from node-fetch.
-
Turn CV to structured data with GPT-3 and Node.js
node-fetch - NodeFetch is used to fetch the CV document.
-
Stop polyfilling fetch in your npm package
So for all versions of Node.js ≤17, you’ll need a Node fetch polyfill, the most popular of which is node-fetch: https://github.com/node-fetch/node-fetch
-
Exploring competitive features in Node.js v18 and v19
Before Node.js v18, you had to install node-fetch or Axios to request a resource from a server. With Node.js v18, you no longer need to install either package thanks to v18’s experimental Fetch API, which is available globally.
-
Scaling Your Compute Resources on Salesforce
Best of all, since this particular function runs on Node.js, you can install and use any NPM package to supplement your code. Let’s do that right now by installing node-fetch to issue our HTTP request:
What are some alternatives?
axios - Promise based HTTP client for the browser and node.js
request - 🏊🏾 Simplified HTTP request client.
got - 🌐 Human-friendly and powerful HTTP request library for Node.js
cross-fetch - Universal WHATWG Fetch API for Node, Browsers and React Native.
superagent - Ajax for Node.js and browsers (JS HTTP client). Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs.
isomorphic-fetch - Isomorphic WHATWG Fetch API, for Node & Browserify
http-proxy - A full-featured http proxy for node.js
Nock - HTTP server mocking and expectations library for Node.js
Express - Fast, unopinionated, minimalist web framework for node.