listening event (Cluster)

Event: 'listening' worker <cluster.Worker> address <Object> After calling listen() from a worker, when the 'listening' event is emitted on the server, a 'listening' event will also be emitted on cluster in the master. The event handler is executed with two arguments, the worker contains the worker object and the address object contains the following connection properties: address, port and addressType. This is very useful if the worker is listening on more than one address.

module.parent

module.parent <Object> Module object The module that first required this one.

fs.readFile()

fs.readFile(file[, options], callback) file <String> | <Integer> filename or file descriptor options <Object> | <String> encoding <String> | <Null> default = null flag <String> default = 'r' callback <Function> Asynchronously reads the entire contents of a file. Example: fs.readFile('/etc/passwd', (err, data) => { if (err) throw err; console.log(data); }); The callback is passed two arguments (err, data), where data is the conten

fs.symlink()

fs.symlink(target, path[, type], callback) Asynchronous symlink(2). No arguments other than a possible exception are given to the completion callback. The type argument can be set to 'dir', 'file', or 'junction' (default is 'file') and is only available on Windows (ignored on other platforms). Note that Windows junction points require the destination path to be absolute. When using 'junction', the target argument will automatically be normalized to absolute path. Here is an example below: fs.

path.join()

path.join([path1][, path2][, ...]) Join all arguments together and normalize the resulting path. Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown. Example: path.join('/foo', 'bar', 'baz/asdf', 'quux', '..') // returns '/foo/bar/baz/asdf' path.join('foo', {}, 'bar') // throws exception TypeError: Arguments to path.join must be strings Note: If the arguments to join have zero-length strings, unlike other path module functi

process.versions

process.versions A property exposing version strings of Node.js and its dependencies. console.log(process.versions); Will print something like: { http_parser: '2.3.0', node: '1.1.1', v8: '4.1.0.14', uv: '1.3.0', zlib: '1.2.8', ares: '1.10.0-DEV', modules: '43', icu: '55.1', openssl: '1.0.1k' }

cryptoStream.bytesWritten

cryptoStream.bytesWritten A proxy to the underlying socket's bytesWritten accessor, this will return the total bytes written to the socket, including the TLS overhead.

path.isAbsolute()

path.isAbsolute(path) Determines whether path is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. Posix examples: path.isAbsolute('/foo/bar') // true path.isAbsolute('/baz/..') // true path.isAbsolute('qux/') // false path.isAbsolute('.') // false Windows examples: path.isAbsolute('//server') // true path.isAbsolute('C:/foo/..') // true path.isAbsolute('bar\\baz') // false path.isAbsolute('.') // false Not

domain.exit()

domain.exit() The exit method exits the current domain, popping it off the domain stack. Any time execution is going to switch to the context of a different chain of asynchronous calls, it's important to ensure that the current domain is exited. The call to exit delimits either the end of or an interruption to the chain of asynchronous calls and I/O operations bound to a domain. If there are multiple, nested domains bound to the current execution context, exit will exit any domains nested with

uncaughtException event (Process)

Event: 'uncaughtException' The 'uncaughtException' event is emitted when an exception bubbles all the way back to the event loop. By default, Node.js handles such exceptions by printing the stack trace to stderr and exiting. Adding a handler for the 'uncaughtException' event overrides this default behavior. For example: process.on('uncaughtException', (err) => { console.log(`Caught exception: ${err}`); }); setTimeout(() => { console.log('This will still run.'); }, 500); // Intenti