response.statusMessage

response.statusMessage When using implicit headers (not calling response.writeHead() explicitly), this property controls the status message that will be sent to the client when the headers get flushed. If this is left as undefined then the standard message for the status code will be used. Example: response.statusMessage = 'Not found'; After response header was sent to the client, this property indicates the status message which was sent out.

TypeError

Class: TypeError A subclass of Error that indicates that a provided argument is not an allowable type. For example, passing a function to a parameter which expects a string would be considered a TypeError. require('url').parse(function() { }); // throws TypeError, since it expected a string Node.js will generate and throw TypeError instances immediately as a form of argument validation.

tls.createSecureContext()

tls.createSecureContext(options) Creates a credentials object; the options object may contain the following fields: pfx : A string or Buffer holding the PFX or PKCS12 encoded private key, certificate, and CA certificates. key: A string or Buffer containing the private key of the server in PEM format. To support multiple keys using different algorithms, an array can be provided. It can either be a plain array of keys or an array of objects in the format {pem: key, passphrase: passphrase}. (Re

buffer.writeInt16LE()

buf.writeInt16LE(value, offset[, noAssert]) value <Number> Bytes to be written to Buffer offset <Number> 0 <= offset <= buf.length - 2 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 (writeInt16BE() writes big endian, writeInt16LE() writes little endian). The value should be a valid signed 16-bit integer. Behavior is not defined when

util.puts()

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

__dirname

__dirname {String} The name of the directory that the currently executing script resides in. Example: running node example.js from /Users/mjr console.log(__dirname); // /Users/mjr __dirname isn't actually a global but rather local to each module. For instance, given two modules: a and b, where b is a dependency of a and there is a directory structure of: /Users/mjr/app/a.js /Users/mjr/app/node_modules/b/b.js References to __dirname within b.js will return /Users/mjr/app/node_modules/b w

buffer.indexOf()

buf.indexOf(value[, byteOffset][, encoding]) value <String> | <Buffer> | <Number> byteOffset <Number> Default: 0 encoding <String> Default: 'utf8' Return: <Number> Operates similar to Array#indexOf() in that it returns either the starting index position of value in Buffer or -1 if the Buffer does not contain value. The value can be a String, Buffer or Number. Strings are by default interpreted as UTF8. Buffers will use the entire Buffer (to compare a

buffer.readInt32BE()

buf.readInt32BE(offset[, noAssert])

buffer.readInt8()

buf.readInt8(offset[, noAssert]) offset <Number> 0 <= offset <= buf.length - 1 noAssert <Boolean> Default: false Return: <Number> Reads a signed 8-bit integer from the Buffer at the specified offset. Setting noAssert to true skips validation of the offset. This allows the offset to be beyond the end of the Buffer. Integers read from the Buffer are interpreted as two's complement signed values. const buf = Buffer.from([1,-2,3,4]); buf.readInt8(0); // returns 1

buffer.readUInt16LE()

buf.readUInt16LE(offset[, noAssert]) offset <Number> 0 <= offset <= buf.length - 2 noAssert <Boolean> Default: false Return: <Number> Reads an unsigned 16-bit integer from the Buffer at the specified offset with specified endian format (readInt32BE() returns big endian, readInt32LE() returns little endian). Setting noAssert to true skips validation of the offset. This allows the offset to be beyond the end of the Buffer. Example: const buf = Buffer.from([0x3, 0x