Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

undici

Package Overview
Dependencies
Maintainers
3
Versions
216
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

undici - npm Package Compare versions

Comparing version 4.4.7 to 4.5.0

types/fetch.d.ts

4

index.d.ts

@@ -14,2 +14,6 @@ import Dispatcher from './types/dispatcher'

export * from './types/fetch'
export * from './types/file'
export * from './types/formdata'
export { Dispatcher, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, MockClient, MockPool, MockAgent, mockErrors }

@@ -16,0 +20,0 @@ export default Undici

2

package.json
{
"name": "undici",
"version": "4.4.7",
"version": "4.5.0",
"description": "An HTTP/1.1 client, written from scratch for Node.js",

@@ -5,0 +5,0 @@ "homepage": "https://undici.nodejs.org",

@@ -169,2 +169,35 @@ # undici

#### Specification Compliance
This section documents parts of the [fetch specification](https://fetch.spec.whatwg.org) which Undici does
not support or does not fully implement.
##### Garbage Collection
* https://fetch.spec.whatwg.org/#garbage-collection
The fetch specication allows users to skip consuming the response body by relying on
garbage collection to release connection resources. Undici does the same. However,
garbage collection in node is less aggressive and deterministic (due to the lack
of clear idle periods that browser have through the rendering refresh rate)
which means that leaving the release of connection resources to the garbage collector
can lead to excessive connection usage, reduced performance (due to less connection re-use),
and even stalls or deadlocks when running out of connections. Therefore, it is highly
recommended to always either consume or cancel the response body.
```js
// Do
const headers = await fetch(url)
.then(async res => {
for await (const chunk of res) {
// force consumption of body
}
return res.headers
})
// Do not
const headers = await fetch(url)
.then(res => res.headers)
```
### `undici.upgrade([url, options]): Promise`

@@ -171,0 +204,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc