From 1dc2977c94583efbecd5b6791b5a091d18a2ceeb Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Fri, 22 Apr 2022 10:13:45 +0000 Subject: [PATCH] docs(readme): minor grammar fixes (#1354) * docs(readme): minor grammar fixes * Update README.md Co-authored-by: Robert Nagy * docs(readme): clarity updates Co-authored-by: Robert Nagy --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 60c2b6fbc48..e0af350ec7d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Node CI](https://github.com/nodejs/undici/actions/workflows/nodejs.yml/badge.svg)](https://github.com/nodejs/undici/actions/workflows/nodejs.yml) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) [![npm version](https://badge.fury.io/js/undici.svg)](https://badge.fury.io/js/undici) [![codecov](https://codecov.io/gh/nodejs/undici/branch/main/graph/badge.svg?token=yZL6LtXkOA)](https://codecov.io/gh/nodejs/undici) -A HTTP/1.1 client, written from scratch for Node.js. +An HTTP/1.1 client, written from scratch for Node.js. > Undici means eleven in Italian. 1.1 -> 11 -> Eleven -> Undici. It is also a Stranger Things reference. @@ -93,7 +93,7 @@ console.log('trailers', trailers) _Note: Once a mixin has been called then the body cannot be reused, thus calling additional mixins on `.body`, e.g. `.body.json(); .body.text()` will result in an error `TypeError: unusable` being thrown and returned through the `Promise` rejection._ -Should you need to access the `body` in plain-text after using a mixin, the best practice is to use the `.text()` mixin first, and manually parse the text to the desired format. +Should you need to access the `body` in plain-text after using a mixin, the best practice is to use the `.text()` mixin first and then manually parse the text to the desired format. For more information about their behavior, please reference the body mixin from the [Fetch Standard](https://fetch.spec.whatwg.org/#body-mixin). @@ -227,7 +227,7 @@ const data = { #### `response.body` -Nodejs has two kinds of streams: [web streams](https://nodejs.org/dist/latest-v16.x/docs/api/webstreams.html) which follow the API of the WHATWG web standard found in browsers, and an older Node-specific [streams API](https://nodejs.org/api/stream.html). `response.body` returns a readable web stream. If you would prefer to work with a Node stream you can convert a web stream using `.fromWeb()`. +Nodejs has two kinds of streams: [web streams](https://nodejs.org/dist/latest-v16.x/docs/api/webstreams.html), which follow the API of the WHATWG web standard found in browsers, and an older Node-specific [streams API](https://nodejs.org/api/stream.html). `response.body` returns a readable web stream. If you would prefer to work with a Node stream you can convert a web stream using `.fromWeb()`. ```js import {fetch} from 'undici'; @@ -242,7 +242,7 @@ Nodejs has two kinds of streams: [web streams](https://nodejs.org/dist/latest-v1 #### Specification Compliance -This section documents parts of the [Fetch Standard](https://fetch.spec.whatwg.org) which Undici does +This section documents parts of the [Fetch Standard](https://fetch.spec.whatwg.org) that Undici does not support or does not fully implement. ##### Garbage Collection @@ -253,7 +253,7 @@ The [Fetch Standard](https://fetch.spec.whatwg.org) allows users to skip consumi [garbage collection](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Memory_Management#garbage_collection) to release connection resources. Undici does not do the same. Therefore, it is important to always either consume or cancel the response body. 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) +(due to the lack of clear idle periods that browsers 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. @@ -315,7 +315,7 @@ Returns: `Dispatcher` ## Specification Compliance -This section documents parts of the HTTP/1.1 specification which Undici does +This section documents parts of the HTTP/1.1 specification that Undici does not support or does not fully implement. ### Expect @@ -348,7 +348,7 @@ aborted. ### Manual Redirect -Since it is not possible to manually follow an HTTP redirect on server-side, +Since it is not possible to manually follow an HTTP redirect on the server-side, Undici returns the actual response instead of an `opaqueredirect` filtered one when invoked with a `manual` redirect. This aligns `fetch()` with the other implementations in Deno and Cloudflare Workers.