From 7bfa5cf284de1f1c00dafa651bff5ea225e98825 Mon Sep 17 00:00:00 2001 From: isaacs Date: Mon, 27 Feb 2012 11:18:10 -0800 Subject: [PATCH] s/streams/stream/ --- doc/api/_toc.markdown | 2 +- doc/api/all.markdown | 2 +- doc/api/fs.markdown | 4 ++-- doc/api/http.markdown | 8 ++++---- doc/api/net.markdown | 2 +- doc/api/{streams.markdown => stream.markdown} | 4 +++- doc/api/tls.markdown | 2 +- 7 files changed, 13 insertions(+), 11 deletions(-) rename doc/api/{streams.markdown => stream.markdown} (98%) diff --git a/doc/api/_toc.markdown b/doc/api/_toc.markdown index 1c1f0712f6..73e6b9bd58 100644 --- a/doc/api/_toc.markdown +++ b/doc/api/_toc.markdown @@ -9,7 +9,7 @@ * [Utilities](util.html) * [Events](events.html) * [Buffer](buffer.html) -* [Streams](streams.html) +* [Stream](stream.html) * [Crypto](crypto.html) * [TLS/SSL](tls.html) * [String Decoder](string_decoder.html) diff --git a/doc/api/all.markdown b/doc/api/all.markdown index 60c4ade3f0..7b7f736956 100644 --- a/doc/api/all.markdown +++ b/doc/api/all.markdown @@ -9,7 +9,7 @@ @include util @include events @include buffer -@include streams +@include stream @include crypto @include tls @include string_decoder diff --git a/doc/api/fs.markdown b/doc/api/fs.markdown index b39aaa443c..55ee35a0f5 100644 --- a/doc/api/fs.markdown +++ b/doc/api/fs.markdown @@ -515,7 +515,7 @@ An example to read the last 10 bytes of a file which is 100 bytes long: ## Class: fs.ReadStream -`ReadStream` is a [Readable Stream](streams.html#readable_Stream). +`ReadStream` is a [Readable Stream](stream.html#readable_stream). ### Event: 'open' @@ -541,7 +541,7 @@ default mode `w`. ## fs.WriteStream -`WriteStream` is a [Writable Stream](streams.html#writable_Stream). +`WriteStream` is a [Writable Stream](stream.html#writable_stream). ### Event: 'open' diff --git a/doc/api/http.markdown b/doc/api/http.markdown index 5cda91da4c..33c92ece4b 100644 --- a/doc/api/http.markdown +++ b/doc/api/http.markdown @@ -128,7 +128,7 @@ See [net.Server.close()](net.html#server.close). This object is created internally by a HTTP server -- not by the user -- and passed as the first argument to a `'request'` listener. -The request implements the [Readable Stream](streams.html#readable_Stream) +The request implements the [Readable Stream](stream.html#readable_stream) interface. This is an `EventEmitter` with the following events: ### Event: 'data' @@ -248,7 +248,7 @@ authentication details. This object is created internally by a HTTP server--not by the user. It is passed as the second parameter to the `'request'` event. -The response implements the [Writable Stream](streams.html#writable_Stream) +The response implements the [Writable Stream](stream.html#writable_stream) interface. This is an `EventEmitter` with the following events: ### Event: 'close' @@ -583,7 +583,7 @@ event, the entire body will be caught. Note: Node does not check whether Content-Length and the length of the body which has been transmitted are equal or not. -The request implements the [Writable Stream](streams.html#writable_Stream) +The request implements the [Writable Stream](stream.html#writable_stream) interface. This is an `EventEmitter` with the following events: ### Event 'response' @@ -715,7 +715,7 @@ will be called. This object is created when making a request with `http.request()`. It is passed to the `'response'` event of the request object. -The response implements the [Readable Stream](streams.html#readable_Stream) +The response implements the [Readable Stream](stream.html#readable_stream) interface. This is an `EventEmitter` with the following events: diff --git a/doc/api/net.markdown b/doc/api/net.markdown index d3c2bff8b4..8c3654df63 100644 --- a/doc/api/net.markdown +++ b/doc/api/net.markdown @@ -377,7 +377,7 @@ See `connect()`. Emitted when data is received. The argument `data` will be a `Buffer` or `String`. Encoding of data is set by `socket.setEncoding()`. -(See the [Readable Stream](streams.html#readable_Stream) section for more +(See the [Readable Stream](stream.html#readable_stream) section for more information.) Note that the __data will be lost__ if there is no listener when a `Socket` diff --git a/doc/api/streams.markdown b/doc/api/stream.markdown similarity index 98% rename from doc/api/streams.markdown rename to doc/api/stream.markdown index b542de066e..0edf22fbd5 100644 --- a/doc/api/streams.markdown +++ b/doc/api/stream.markdown @@ -1,9 +1,11 @@ -# Streams +# Stream A stream is an abstract interface implemented by various objects in Node. For example a request to an HTTP server is a stream, as is stdout. Streams are readable, writable, or both. All streams are instances of `EventEmitter`. +You can load up the Stream base class by doing `require('stream')`. + ## Readable Stream diff --git a/doc/api/tls.markdown b/doc/api/tls.markdown index fa0dad013f..f79c6203b4 100644 --- a/doc/api/tls.markdown +++ b/doc/api/tls.markdown @@ -319,7 +319,7 @@ The number of concurrent connections on the server. This is a stream on top of the *Encrypted* stream that makes it possible to read/write an encrypted data as a cleartext data. -This instance implements a duplex [Stream](streams.html#streams) interfaces. +This instance implements a duplex [Stream](stream.html) interfaces. It has all the common stream methods and events. A ClearTextStream is the `clear` member of a SecurePair object.