domain.run()

domain.run(fn[, arg][, ...]) fn <Function> Run the supplied function in the context of the domain, implicitly binding all event emitters, timers, and lowlevel requests that are created in that context. Optionally, arguments can be passed to the function. This is the most basic way to use a domain. Example: const domain = require('domain'); const fs = require('fs'); const d = domain.create(); d.on('error', (er) => { console.error('Caught error!', er); }); d.run(() => { pro

domain.remove()

domain.remove(emitter) 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.

url.resolve()

url.resolve(from, to) Take a base URL, and a href URL, and resolve them as a browser would for an anchor tag. Examples: url.resolve('/one/two/three', 'four') // '/one/two/four' url.resolve('http://example.com/', '/one') // 'http://example.com/one' url.resolve('http://example.com/one', '/two') // 'http://example.com/two'

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.

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

dns.resolveSoa()

dns.resolveSoa(hostname, callback) Uses the DNS protocol to resolve a start of authority record (SOA record) for the hostname. The addresses argument passed to the callback function will be an object with the following properties: nsname hostmaster serial refresh retry expire minttl { nsname: 'ns.example.com', hostmaster: 'root.example.com', serial: 2013101809, refresh: 10000, retry: 2400, expire: 604800, minttl: 3600 }

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: '