buffer.slice()

buf.slice([start[, end]]) start <Number> Default: 0 end <Number> Default: buffer.length Return: <Buffer> Returns a new Buffer that references the same memory as the original, but offset and cropped by the start and end indices. Note that modifying the new Buffer slice will modify the memory in the original Buffer because the allocated memory of the two objects overlap. Example: build a Buffer with the ASCII alphabet, take a slice, then modify one byte from the original

process.arch

process.arch What processor architecture you're running on: 'arm', 'ia32', or 'x64'. console.log('This processor architecture is ' + process.arch);

Buffer.concat()

Class Method: Buffer.concat(list[, totalLength]) list <Array> List of Buffer objects to concat totalLength <Number> Total length of the Buffers in the list when concatenated Return: <Buffer> Returns a new Buffer which is the result of concatenating all the Buffers in the list together. If the list has no items, or if the totalLength is 0, then a new zero-length Buffer is returned. If totalLength is not provided, it is calculated from the Buffers in the list. This, howev

childprocess.disconnect()

child.disconnect() Closes the IPC channel between parent and child, allowing the child to exit gracefully once there are no other connections keeping it alive. After calling this method the child.connected and process.connected properties in both the parent and child (respectively) will be set to false, and it will be no longer possible to pass messages between the processes. The 'disconnect' event will be emitted when there are no messages in the process of being received. This will most ofte

cipher.setAAD()

cipher.setAAD(buffer) When using an authenticated encryption mode (only GCM is currently supported), the cipher.setAAD() method sets the value used for the additional authenticated data (AAD) input parameter.

cluster.schedulingPolicy

cluster.schedulingPolicy The scheduling policy, either cluster.SCHED_RR for round-robin or cluster.SCHED_NONE to leave it to the operating system. This is a global setting and effectively frozen once you spawn the first worker or call cluster.setupMaster(), whatever comes first. SCHED_RR is the default on all operating systems except Windows. Windows will change to SCHED_RR once libuv is able to effectively distribute IOCP handles without incurring a large performance hit. cluster.schedulingP

buffer.swap16()

buf.swap16() Return: <Buffer> Interprets the Buffer as an array of unsigned 16-bit integers and swaps the byte-order in-place. Throws a RangeError if the Buffer length is not a multiple of 16 bits. The method returns a reference to the Buffer, so calls can be chained. const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); console.log(buf); // Prints Buffer(0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8) buf.swap16(); console.log(buf); // Prints Buffer(0x2, 0x1, 0x4, 0x3, 0x6,

hash.digest()

hash.digest([encoding]) Calculates the digest of all of the data passed to be hashed (using the hash.update() method). The encoding can be 'hex', 'binary' or 'base64'. If encoding is provided a string will be returned; otherwise a Buffer is returned. The Hash object can not be used again after hash.digest() method has been called. Multiple calls will cause an error to be thrown.

crypto.createCipher()

crypto.createCipher(algorithm, password) Creates and returns a Cipher object that uses the given algorithm and password. The algorithm is dependent on OpenSSL, examples are 'aes192', etc. On recent OpenSSL releases, openssl list-cipher-algorithms will display the available cipher algorithms. The password is used to derive the cipher key and initialization vector (IV). The value must be either a 'binary' encoded string or a Buffer. The implementation of crypto.createCipher() derives keys usin

readable.pipe()

Stability: 2 - Stable A stream is an abstract interface implemented by various objects in Node.js. For example a request to an HTTP server is a stream, as is process.stdout. Streams are readable, writable, or both. All streams are instances of EventEmitter. You can load the Stream base classes by doing require('stream'). There are base classes provided for Readable streams, Writable streams, Duplex streams, and Transform streams. This document is split up into 3 sections: The first section e