stream.Writable

Class: stream.Writable stream.Writable is an abstract class designed to be extended with an underlying implementation of the stream._write(chunk, encoding, callback) method. Please see API for Stream Consumers for how to consume writable streams in your programs. What follows is an explanation of how to implement Writable streams in your programs. new stream.Writable([options]) options <Object> highWaterMark <Number> Buffer level when stream.write() starts returning false. Defau

tty.setRawMode()

tty.setRawMode(mode) Stability: 0 - Deprecated: Use tty.ReadStream#setRawMode (i.e. process.stdin.setRawMode) instead.

buffer.writeFloatLE()

buf.writeFloatLE(value, offset[, noAssert]) value <Number> Bytes to be written to Buffer offset <Number> 0 <= offset <= buf.length - 4 noAssert <Boolean> Default: false Return: <Number> The offset plus the number of written bytes Writes value to the Buffer at the specified offset with specified endian format (writeFloatBE() writes big endian, writeFloatLE() writes little endian). Behavior is not defined when value is anything other than a 32-bit float. Set n

decipher.update()

decipher.update(data[, input_encoding][, output_encoding]) Updates the decipher with data. If the input_encoding argument is given, it's value must be one of 'binary', 'base64', or 'hex' and the data argument is a string using the specified encoding. If the input_encoding argument is not given, data must be a Buffer. If data is a Buffer then input_encoding is ignored. The output_encoding specifies the output format of the enciphered data, and can be 'binary', 'ascii' or 'utf8'. If the output_e

fs.createWriteStream()

fs.createWriteStream(path[, options]) Returns a new WriteStream object. (See Writable Stream). options is an object or string with the following defaults: { flags: 'w', defaultEncoding: 'utf8', fd: null, mode: 0o666, autoClose: true } options may also include a start option to allow writing data at some position past the beginning of the file. Modifying a file rather than replacing it may require a flags mode of r+ rather than the default mode w. The defaultEncoding can be any one o

dgram_socket.bind()

socket.bind([port][, address][, callback]) 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 named port and optional address. If port is not specified, the operating system will attempt to bind to a random port. If address is not specified, the operating system will attempt to listen on all addresses. O

buffer.toString()

buf.toString([encoding[, start[, end]]]) encoding <String> Default: 'utf8' start <Number> Default: 0 end <Number> Default: buffer.length Return: <String> Decodes and returns a string from the Buffer data using the specified character set encoding. const buf = Buffer.allocUnsafe(26); for (var i = 0 ; i < 26 ; i++) { buf[i] = i + 97; // 97 is ASCII a } buf.toString('ascii'); // Returns: 'abcdefghijklmnopqrstuvwxyz' buf.toString('ascii',0,5); // Returns: '

util.puts()

util.puts([...]) Stability: 0 - Deprecated: Use console.log() instead. Deprecated predecessor of console.log.

diffieHellman.computeSecret()

diffieHellman.computeSecret(other_public_key[, input_encoding][, output_encoding]) Computes the shared secret using other_public_key as the other party's public key and returns the computed shared secret. The supplied key is interpreted using the specified input_encoding, and secret is encoded using specified output_encoding. Encodings can be 'binary', 'hex', or 'base64'. If the input_encoding is not provided, other_public_key is expected to be a Buffer. If output_encoding is given a string is

crypto.getDiffieHellman()

crypto.getDiffieHellman(group_name) Creates a predefined DiffieHellman key exchange object. The supported groups are: 'modp1', 'modp2', 'modp5' (defined in RFC 2412, but see Caveats) and 'modp14', 'modp15', 'modp16', 'modp17', 'modp18' (defined in RFC 3526). The returned object mimics the interface of objects created by crypto.createDiffieHellman(), but will not allow changing the keys (with diffieHellman.setPublicKey() for example). The advantage of using this method is that the parties do not