Comparing version 4.4.7 to 4.5.0
@@ -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 |
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
604680
82
9576
292