buffer.copy()

buf.copy(targetBuffer[, targetStart[, sourceStart[, sourceEnd]]]) targetBuffer <Buffer> Buffer to copy into targetStart <Number> Default: 0 sourceStart <Number> Default: 0 sourceEnd <Number> Default: buffer.length Return: <Number> The number of bytes copied. Copies data from a region of this Buffer to a region in the target Buffer even if the target memory region overlaps with the source. Example: build two Buffers, then copy buf1 from byte 16 through byte

buffer.swap32()

buf.swap32() Return: <Buffer> Interprets the Buffer as an array of unsigned 32-bit integers and swaps the byte-order in-place. Throws a RangeError if the Buffer length is not a multiple of 32 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.swap32(); console.log(buf); // Prints Buffer(0x4, 0x3, 0x2, 0x1, 0x8,

Buffer.compare()

Class Method: Buffer.compare(buf1, buf2) buf1 <Buffer> buf2 <Buffer> Return: <Number> Compares buf1 to buf2 typically for the purpose of sorting arrays of Buffers. This is equivalent is calling buf1.compare(buf2). const arr = [Buffer.from('1234'), Buffer.from('0123')]; arr.sort(Buffer.compare);

fs.write()

fs.write(fd, buffer, offset, length[, position], callback) Write buffer to the file specified by fd. offset and length determine the part of the buffer to be written. position refers to the offset from the beginning of the file where this data should be written. If typeof position !== 'number', the data will be written at the current position. See pwrite(2). The callback will be given three arguments (err, written, buffer) where written specifies how many bytes were written from buffer. Not

tlsSocket.getCipher()

tlsSocket.getCipher() Returns an object representing the cipher name and the SSL/TLS protocol version that first defined the cipher. Example: { name: 'AES256-SHA', version: 'TLSv1/SSLv3' } See SSL_CIPHER_get_name() and SSL_CIPHER_get_version() in https://www.openssl.org/docs/manmaster/ssl/SSL_CIPHER_get_name.html for more information.

fs.read()

fs.read(fd, buffer, offset, length, position, callback) Read data from the file specified by fd. buffer is the buffer that the data will be written to. offset is the offset in the buffer to start writing at. length is an integer specifying the number of bytes to read. position is an integer specifying where to begin reading from in the file. If position is null, data will be read from the current file position. The callback is given the three arguments, (err, bytesRead, buffer).

continue event (http.ClientRequest)

Event: 'continue' function () { } Emitted when the server sends a '100 Continue' HTTP response, usually because the request contained 'Expect: 100-continue'. This is an instruction that the client should send the request body.

fs.chown()

fs.chown(path, uid, gid, callback) Asynchronous chown(2). No arguments other than a possible exception are given to the completion callback.

request.write()

request.write(chunk[, encoding][, callback]) Sends a chunk of the body. By calling this method many times, the user can stream a request body to a server--in that case it is suggested to use the ['Transfer-Encoding', 'chunked'] header line when creating the request. The chunk argument should be a Buffer or a string. The encoding argument is optional and only applies when chunk is a string. Defaults to 'utf8'. The callback argument is optional and will be called when this chunk of data is flu

close event (Readline)

Event: 'close' function () {} Emitted when close() is called. Also emitted when the input stream receives its 'end' event. The Interface instance should be considered "finished" once this is emitted. For example, when the input stream receives ^D, respectively known as EOT. This event is also called if there is no SIGINT event listener present when the input stream receives a ^C, respectively known as SIGINT.