Skip to content

Commit

Permalink
doc: edit Stream api grammar
Browse files Browse the repository at this point in the history
Sections:
  - Introduction
  - Orginization of this Document
  - Object Mode
  - Buffering
  - API for Stream Implementers

PR-URL: #9100
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
bcmarinacci authored and jasnell committed Oct 17, 2016
1 parent 95d45d7 commit f56bdec
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ The `stream` module can be accessed using:
const stream = require('stream');
```

While it is important for all Node.js users to understand how streams works,
While it is important for all Node.js users to understand how streams work,
the `stream` module itself is most useful for developers that are creating new
types of stream instances. Developer's who are primarily *consuming* stream
objects will rarely (if ever) have need to use the `stream` module directly.

## Organization of this document
## Organization of this Document

This document is divided into two primary sections and third section for
This document is divided into two primary sections with a third section for
additional notes. The first section explains the elements of the stream API that
are required to *use* streams within an application. The second section explains
the elements of the API that are required to *implement* new types of streams.
Expand All @@ -48,7 +48,7 @@ There are four fundamental stream types within Node.js:

All streams created by Node.js APIs operate exclusively on strings and `Buffer`
objects. It is possible, however, for stream implementations to work with other
types of JavaScript values (with the exception of `null` which serves a special
types of JavaScript values (with the exception of `null`, which serves a special
purpose within streams). Such streams are considered to operate in "object
mode".

Expand Down Expand Up @@ -87,7 +87,7 @@ total size of the internal write buffer is below the threshold set by
the size of the internal buffer reaches or exceeds the `highWaterMark`, `false`
will be returned.

A key goal of the `stream` API, and in particular the [`stream.pipe()`] method,
A key goal of the `stream` API, particularly the [`stream.pipe()`] method,
is to limit the buffering of data to acceptable levels such that sources and
destinations of differing speeds will not overwhelm the available memory.

Expand All @@ -98,8 +98,8 @@ appropriate and efficient flow of data. For example, [`net.Socket`][] instances
are [Duplex][] streams whose Readable side allows consumption of data received
*from* the socket and whose Writable side allows writing data *to* the socket.
Because data may be written to the socket at a faster or slower rate than data
is received, it is important each side operate (and buffer) independently of
the other.
is received, it is important for each side to operate (and buffer) independently
of the other.

## API for Stream Consumers

Expand Down Expand Up @@ -1061,7 +1061,7 @@ Examples of Transform streams include:
<!--type=misc-->

The `stream` module API has been designed to make it possible to easily
implement streams using JavaScript's prototypical inheritance model.
implement streams using JavaScript's prototypal inheritance model.

First, a stream developer would declare a new JavaScript class that extends one
of the four basic stream classes (`stream.Writable`, `stream.Readable`,
Expand Down

0 comments on commit f56bdec

Please sign in to comment.