### buf.fill(value[, offset[, end]])
-* `value` {String or Number}
+* `value` {String|Number}
* `offset` {Number} Default: 0
* `end` {Number} Default: `buffer.length`
* Return: {Buffer}
### buf.indexOf(value[, byteOffset][, encoding])
-* `value` {String, Buffer or Number}
+* `value` {String|Buffer|Number}
* `byteOffset` {Number} Default: 0
* `encoding` {String} Default: `'utf8'`
* Return: {Number}
### buf.includes(value[, byteOffset][, encoding])
-* `value` {String, Buffer or Number}
+* `value` {String|Buffer|Number}
* `byteOffset` {Number} Default: 0
* `encoding` {String} Default: `'utf8'`
* Return: {Boolean}
* `error` {Error}
* `stdout` {Buffer}
* `stderr` {Buffer}
-* Return: ChildProcess object
+* Return: {ChildProcess}
Spawns a shell then executes the `command` within that shell, buffering any
generated output.
* `error` {Error}
* `stdout` {Buffer}
* `stderr` {Buffer}
-* Return: ChildProcess object
+* Return: {ChildProcess}
The `child_process.execFile()` function is similar to [`child_process.exec()`][]
except that it does not spawn a shell. Rather, the specified executable `file`
[`stdio`][] for more details (default is false)
* `uid` {Number} Sets the user identity of the process. (See setuid(2).)
* `gid` {Number} Sets the group identity of the process. (See setgid(2).)
-* Return: ChildProcess object
+* Return: {ChildProcess}
The `child_process.fork()` method is a special case of
[`child_process.spawn()`][] used specifically to spawn new Node.js processes.
[`options.detached`][])
* `uid` {Number} Sets the user identity of the process. (See setuid(2).)
* `gid` {Number} Sets the group identity of the process. (See setgid(2).)
-* return: {ChildProcess object}
+* return: {ChildProcess}
The `child_process.spawn()` method spawns a new process using the given
`command`, with command line arguments in `args`. If omitted, `args` defaults
### Event: 'error'
-* `err` {Error Object} the error.
+* `err` {Error} the error.
The `'error'` event is emitted whenever:
### Event: 'message'
* `message` {Object} a parsed JSON object or primitive value.
-* `sendHandle` {Handle object} a [`net.Socket`][] or [`net.Server`][] object, or
+* `sendHandle` {Handle} a [`net.Socket`][] or [`net.Server`][] object, or
undefined.
The `'message'` event is triggered when a child process uses `process.send()`
### child.pid
-* {Integer}
+* {Number} Integer
Returns the process identifier (PID) of the child process.
### child.send(message[, sendHandle][, callback])
* `message` {Object}
-* `sendHandle` {Handle object}
+* `sendHandle` {Handle}
* `callback` {Function}
-* Return: Boolean
+* Return: {Boolean}
When an IPC channel has been established between the parent and child (
i.e. when using [`child_process.fork()`][]), the `child.send()` method can be
### child.stderr
-* {Stream object}
+* {Stream}
A `Readable Stream` that represents the child process's `stderr`.
### child.stdin
-* {Stream object}
+* {Stream}
A `Writable Stream` that represents the child process's `stdin`.
### child.stdout
-* {Stream object}
+* {Stream}
A `Readable Stream` that represents the child process's `stdout`.
### worker.process
-* {ChildProcess object}
+* {ChildProcess}
All workers are created using [`child_process.fork()`][], the returned object
from this function is stored as `.process`. In a worker, the global `process`
### worker.send(message[, sendHandle][, callback])
* `message` {Object}
-* `sendHandle` {Handle object}
+* `sendHandle` {Handle}
* `callback` {Function}
* Return: Boolean
## Event: 'disconnect'
-* `worker` {Worker object}
+* `worker` {cluster.Worker}
Emitted after the worker IPC channel has disconnected. This can occur when a
worker exits gracefully, is killed, or is disconnected manually (such as with
## Event: 'exit'
-* `worker` {Worker object}
+* `worker` {cluster.Worker}
* `code` {Number} the exit code, if it exited normally.
* `signal` {String} the name of the signal (eg. `'SIGHUP'`) that caused
the process to be killed.
## Event: 'fork'
-* `worker` {Worker object}
+* `worker` {cluster.Worker}
When a new worker is forked the cluster module will emit a `'fork'` event.
This can be used to log worker activity, and create your own timeout.
## Event: 'listening'
-* `worker` {Worker object}
+* `worker` {cluster.Worker}
* `address` {Object}
After calling `listen()` from a worker, when the `'listening'` event is emitted on
## Event: 'message'
-* `worker` {Worker object}
+* `worker` {cluster.Worker}
* `message` {Object}
Emitted when any worker receives a message.
## Event: 'online'
-* `worker` {Worker object}
+* `worker` {cluster.Worker}
After forking a new worker, the worker should respond with an online message.
When the master receives an online message it will emit this event.
## cluster.fork([env])
* `env` {Object} Key/value pairs to add to worker process environment.
-* return {Worker object}
+* return {cluster.Worker}
Spawn a new worker process.
string, it is treated as a raw key with no passphrase. If `private_key` is an
object, it is interpreted as a hash containing two properties:
-* `key` : A string holding the PEM encoded private key
-* `passphrase` : A string of passphrase for the private key
+* `key` : {String} - PEM encoded private key
+* `passphrase` : {String} - passphrase for the private key
The `output_format` can specify one of `'binary'`, `'hex'` or `'base64'`. If
`output_format` is provided a string is returned; otherwise a [`Buffer`][] is
The optional `details` argument is a hash object with keys:
-* `pfx` : A string or [`Buffer`][] holding the PFX or PKCS12 encoded private
+* `pfx` : {String|Buffer} - PFX or PKCS12 encoded private
key, certificate and CA certificates
-* `key` : A string holding the PEM encoded private key
-* `passphrase` : The string passphrase for the private key or PFX
-* `cert` : A string holding the PEM encoded certificate
-* `ca` : Either a string or array of strings of PEM encoded CA
+* `key` : {String} - PEM encoded private key
+* `passphrase` : {String} - passphrase for the private key or PFX
+* `cert` : {String} - PEM encoded certificate
+* `ca` : {String|Array} - Either a string or array of strings of PEM encoded CA
certificates to trust.
-* `crl` : Either a string or array of strings of PEM encoded CRLs
+* `crl` : {String|Array} - Either a string or array of strings of PEM encoded CRLs
(Certificate Revocation List)
-* `ciphers`: A string using the [OpenSSL cipher list format][] describing the
+* `ciphers`: {String} using the [OpenSSL cipher list format][] describing the
cipher algorithms to use or exclude.
If no 'ca' details are given, Node.js will use Mozilla's default
If `private_key` is an object, it is interpreted as a hash object with the
keys:
-* `key` : A string holding the PEM encoded private key
-* `passphrase` : An optional string of passphrase for the private key
+* `key` : {String} - PEM encoded private key
+* `passphrase` : {String} - Optional passphrase for the private key
* `padding` : An optional padding value, one of the following:
* `constants.RSA_NO_PADDING`
* `constants.RSA_PKCS1_PADDING`
If `private_key` is an object, it is interpreted as a hash object with the
keys:
-* `key` : A string holding the PEM encoded private key
-* `passphrase` : An optional string of passphrase for the private key
+* `key` : {String} - PEM encoded private key
+* `passphrase` : {String} - Optional passphrase for the private key
* `padding` : An optional padding value, one of the following:
* `constants.RSA_NO_PADDING`
* `constants.RSA_PKCS1_PADDING`
If `public_key` is an object, it is interpreted as a hash object with the
keys:
-* `key` : A string holding the PEM encoded public key
-* `passphrase` : An optional string of passphrase for the private key
+* `key` : {String} - PEM encoded public key
+* `passphrase` : {String} - Optional passphrase for the private key
* `padding` : An optional padding value, one of the following:
* `constants.RSA_NO_PADDING`
* `constants.RSA_PKCS1_PADDING`
If `public_key` is an object, it is interpreted as a hash object with the
keys:
-* `key` : A string holding the PEM encoded public key
-* `passphrase` : An optional string of passphrase for the private key
+* `key` : {String} - PEM encoded public key
+* `passphrase` : {String} - Optional passphrase for the private key
* `padding` : An optional padding value, one of the following:
* `constants.RSA_NO_PADDING`
* `constants.RSA_PKCS1_PADDING`
### Event: 'error'
-* `exception` Error object
+* `exception` {Error}
The `'error'` event is emitted whenever any error occurs. The event handler
function is passed a single Error object.
### Event: 'message'
-* `msg` Buffer object. The message
-* `rinfo` Object. Remote address information
+* `msg` {Buffer} - The message
+* `rinfo` {Object} - Remote address information
The `'message'` event is emitted when a new datagram is available on a socket.
The event handler function is passed two arguments: `msg` and `rinfo`. The
### socket.addMembership(multicastAddress[, multicastInterface])
-* `multicastAddress` String
-* `multicastInterface` String, Optional
+* `multicastAddress` {String}
+* `multicastInterface` {String}, Optional
Tells the kernel to join a multicast group at the given `multicastAddress`
using the `IP_ADD_MEMBERSHIP` socket option. If the `multicastInterface`
### socket.bind([port][, address][, callback])
-* `port` Integer, Optional
-* `address` String, Optional
-* `callback` Function with no parameters, Optional. Called when
+* `port` {Number} - Integer, Optional
+* `address` {String}, Optional
+* `callback` {Function} with no parameters, Optional. Called when
binding is complete.
For UDP sockets, causes the `dgram.Socket` to listen for datagram messages on a
### socket.dropMembership(multicastAddress[, multicastInterface])
-* `multicastAddress` String
-* `multicastInterface` String, Optional
+* `multicastAddress` {String}
+* `multicastInterface` {String}, Optional
Instructs the kernel to leave a multicast group at `multicastAddress` using the
`IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the
### socket.send(buf, offset, length, port, address[, callback])
-* `buf` Buffer object or string. Message to be sent
-* `offset` Integer. Offset in the buffer where the message starts.
-* `length` Integer. Number of bytes in the message.
-* `port` Integer. Destination port.
-* `address` String. Destination hostname or IP address.
-* `callback` Function. Called when the message has been sent. Optional.
+* `buf` {Buffer|String} Message to be sent
+* `offset` {Number} Integer. Offset in the buffer where the message starts.
+* `length` {Number} Integer. Number of bytes in the message.
+* `port` {Number} Integer. Destination port.
+* `address` {String} Destination hostname or IP address.
+* `callback` {Function} Called when the message has been sent. Optional.
Broadcasts a datagram on the socket. The destination `port` and `address` must
be specified.
### socket.setBroadcast(flag)
-* `flag` Boolean
+* `flag` {Boolean}
Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP
packets may be sent to a local interface's broadcast address.
### socket.setMulticastLoopback(flag)
-* `flag` Boolean
+* `flag` {Boolean}
Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`,
multicast packets will also be received on the local interface.
### socket.setMulticastTTL(ttl)
-* `ttl` Integer
+* `ttl` {Number} Integer
Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for
"Time to Live", in this context it specifies the number of IP hops that a
### socket.setTTL(ttl)
-* `ttl` Integer
+* `ttl` {Number} Integer
Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live",
in this context it specifies the number of IP hops that a packet is allowed to
### dgram.createSocket(options[, callback])
-* `options` Object
-* `callback` Function. Attached as a listener to `'message'` events.
-* Returns: Socket object
+* `options` {Object}
+* `callback` {Function} Attached as a listener to `'message'` events.
+* Returns: {dgram.Socket}
Creates a `dgram.Socket` object. The `options` argument is an object that
should contain a `type` field of either `udp4` or `udp6` and an optional
### dgram.createSocket(type[, callback])
-* `type` String. Either 'udp4' or 'udp6'
-* `callback` Function. Attached as a listener to `'message'` events.
+* `type` {String} - Either 'udp4' or 'udp6'
+* `callback` {Function} - Attached as a listener to `'message'` events.
Optional
-* Returns: Socket object
+* Returns: {dgram.Socket}
Creates a `dgram.Socket` object of the specified `type`. The `type` argument
can be either `udp4` or `udp6`. An optional `callback` function can be passed
### domain.add(emitter)
-* `emitter` {EventEmitter | Timer} emitter or timer to be added to the domain
+* `emitter` {EventEmitter|Timer} emitter or timer to be added to the domain
Explicitly adds an emitter to the domain. If any event handlers called by
the emitter throw an error, or if the emitter emits an `'error'` event, it
### domain.remove(emitter)
-* `emitter` {EventEmitter | Timer} emitter or timer to be removed from the domain
+* `emitter` {EventEmitter|Timer} emitter or timer to be removed from the domain
The opposite of [`domain.add(emitter)`][]. Removes domain handling from the
specified emitter.
### Event: 'error'
-* `error` {Error object}
+* `error` {Error}
Emitted when an error occurs.
### Event: 'open'
-* `fd` {Integer} file descriptor used by the ReadStream.
+* `fd` {Number} Integer file descriptor used by the ReadStream.
Emitted when the ReadStream's file is opened.
### Event: 'open'
-* `fd` {Integer} file descriptor used by the WriteStream.
+* `fd` {Number} Integer file descriptor used by the WriteStream.
Emitted when the WriteStream's file is opened.
## fs.appendFile(file, data[, options], callback)
-* `file` {String | Integer} filename or file descriptor
-* `data` {String | Buffer}
-* `options` {Object | String}
- * `encoding` {String | Null} default = `'utf8'`
+* `file` {String|Number} filename or file descriptor
+* `data` {String|Buffer}
+* `options` {Object|String}
+ * `encoding` {String|Null} default = `'utf8'`
* `mode` {Number} default = `0o666`
* `flag` {String} default = `'a'`
* `callback` {Function}
### module.parent
-* {Module Object}
+* {Object} Module object
The module that first required this one.
### Event: 'connection'
-* {Socket object} The connection object
+* {net.Socket} The connection object
Emitted when a new connection is made. `socket` is an instance of
`net.Socket`.
### Event: 'error'
-* {Error Object}
+* {Error}
Emitted when an error occurs. The [`'close'`][] event will be called directly
following this event. See example in discussion of `server.listen`.
### Event: 'data'
-* {Buffer object}
+* {Buffer}
Emitted when data is received. The argument `data` will be a `Buffer` or
`String`. Encoding of data is set by `socket.setEncoding()`.
### Event: 'error'
-* {Error object}
+* {Error}
Emitted when an error occurs. The `'close'` event will be called directly
following this event.
Emitted after resolving the hostname but before connecting.
Not applicable to UNIX sockets.
-* `err` {Error | Null} The error object. See [`dns.lookup()`][].
+* `err` {Error|Null} The error object. See [`dns.lookup()`][].
* `address` {String} The IP address.
-* `family` {String | Null} The address type. See [`dns.lookup()`][].
+* `family` {String|Null} The address type. See [`dns.lookup()`][].
### Event: 'timeout'
#### Event: 'data'
-* `chunk` {Buffer | String} The chunk of data.
+* `chunk` {Buffer|String} The chunk of data.
Attaching a `'data'` event listener to a stream that has not been
explicitly paused will switch the stream into flowing mode. Data will
#### readable.isPaused()
-* Return: `Boolean`
+* Return: {Boolean}
This method returns whether or not the `readable` has been **explicitly**
paused by client code (using [`stream.pause()`][stream-pause] without a
#### readable.pipe(destination[, options])
-* `destination` {[Writable][] Stream} The destination for writing data
+* `destination` {stream.Writable} The destination for writing data
* `options` {Object} Pipe options
* `end` {Boolean} End the writer when the reader ends. Default = `true`
#### readable.read([size])
* `size` {Number} Optional argument to specify how much data to read.
-* Return {String | Buffer | null}
+* Return {String|Buffer|Null}
The `read()` method pulls some data out of the internal buffer and
returns it. If there is no data available, then it will return
#### readable.unpipe([destination])
-* `destination` {[Writable][] Stream} Optional specific stream to unpipe
+* `destination` {stream.Writable} Optional specific stream to unpipe
This method will remove the hooks set up for a previous [`stream.pipe()`][]
call.
#### readable.unshift(chunk)
-* `chunk` {Buffer | String} Chunk of data to unshift onto the read queue
+* `chunk` {Buffer|String} Chunk of data to unshift onto the read queue
This is useful in certain cases where a stream is being consumed by a
parser, which needs to "un-consume" some data that it has
#### Event: 'error'
-* {Error object}
+* {Error}
Emitted if there was an error when writing or piping data.
#### Event: 'pipe'
-* `src` {[Readable][] Stream} source stream that is piping to this writable
+* `src` {stream.Readable} source stream that is piping to this writable
This is emitted whenever the [`stream.pipe()`][] method is called on a readable
stream, adding this writable to its set of destinations.
#### writable.end([chunk][, encoding][, callback])
-* `chunk` {String | Buffer} Optional data to write
+* `chunk` {String|Buffer} Optional data to write
* `encoding` {String} The encoding, if `chunk` is a String
* `callback` {Function} Optional callback for when the stream is finished
#### writable.write(chunk[, encoding][, callback])
-* `chunk` {String | Buffer} The data to write
+* `chunk` {String|Buffer} The data to write
* `encoding` {String} The encoding, if `chunk` is a String
* `callback` {Function} Callback for when this chunk of data is flushed
* Returns: {Boolean} `true` if the data was handled completely.
#### readable.push(chunk[, encoding])
-* `chunk` {Buffer | null | String} Chunk of data to push into the read queue
-* `encoding` {String} Encoding of String chunks. Must be a valid
+
+* `chunk` {Buffer|Null|String} Chunk of data to push into the read queue
+* `encoding` {String} Encoding of String chunks. Must be a valid
Buffer encoding, such as `'utf8'` or `'ascii'`
* return {Boolean} Whether or not more pushes should be performed
#### transform._transform(chunk, encoding, callback)
-* `chunk` {Buffer | String} The chunk to be transformed. Will **always**
+* `chunk` {Buffer|String} The chunk to be transformed. Will **always**
be a buffer unless the `decodeStrings` option was set to `false`.
* `encoding` {String} If the chunk is a string, then this is the
encoding type. If chunk is a buffer, then this is the special
#### writable._write(chunk, encoding, callback)
-* `chunk` {Buffer | String} The chunk to be written. Will **always**
+* `chunk` {Buffer|String} The chunk to be written. Will **always**
be a buffer unless the `decodeStrings` option was set to `false`.
* `encoding` {String} If the chunk is a string, then this is the
encoding type. If chunk is a buffer, then this is the special
background: inherit;
}
-span.type {
- color: #222;
+span.type, a.type {
+ font-size: 0.9em;
+ padding: 0.2em 0.4em;
+ line-height: 1.5em;
+ font-family: Monaco, Consolas, "Lucida Console", monospace;
+ margin: 0;
}
#content {