crypto.createCredentials()

crypto.createCredentials(details) Stability: 0 - Deprecated: Use tls.createSecureContext() instead. The crypto.createCredentials() method is a deprecated alias for creating and returning a tls.SecureContext object. The crypto.createCredentials() method should not be used. The optional details argument is a hash object with keys: pfx : {String|Buffer} - PFX or PKCS12 encoded private key, certificate and CA certificates key : {String} - PEM encoded private key passphrase : {String} - passphr

diffieHellman.getPublicKey()

diffieHellman.getPublicKey([encoding]) Returns the Diffie-Hellman public key in the specified encoding, which can be 'binary', 'hex', or 'base64'. If encoding is provided a string is returned; otherwise a Buffer is returned.

replServer.displayPrompt()

replServer.displayPrompt([preserveCursor]) preserveCursor <Boolean> Like readline.prompt except also adding indents with ellipses when inside blocks. The preserveCursor argument is passed to readline.prompt. This is used primarily with defineCommand. It's also used internally to render each prompt line.

response.setHeader()

response.setHeader(name, value) Sets a single header value for implicit headers. If this header already exists in the to-be-sent headers, its value will be replaced. Use an array of strings here if you need to send multiple headers with the same name. Example: response.setHeader('Content-Type', 'text/html'); or response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']); Attempting to set a header field name or value that contains invalid characters will result in a TypeError bei

script.runInContext()

script.runInContext(contextifiedSandbox[, options]) Similar to vm.runInContext() but a method of a precompiled Script object. script.runInContext() runs script's compiled code in contextifiedSandbox and returns the result. Running code does not have access to local scope. script.runInContext() takes the same options as script.runInThisContext(). Example: compile code that increments a global variable and sets one, then execute the code multiple times. These globals are contained in the sandbo

tlsSocket.getPeerCertificate()

tlsSocket.getPeerCertificate([ detailed ]) Returns an object representing the peer's certificate. The returned object has some properties corresponding to the fields of the certificate. If the detailed argument is true the full chain with the issuer property will be returned, if false only the top certificate without the issuer property. Example: { subject: { C: 'UK', ST: 'Acknack Ltd', L: 'Rhys Jones', O: 'node.js', OU: 'Test TLS Certificate', CN: 'localhost' },

drain event (net.Socket)

Event: 'drain' Emitted when the write buffer becomes empty. Can be used to throttle uploads. See also: the return values of socket.write()

options.stdio

Stability: 2 - Stable The child_process module provides the ability to spawn child processes in a manner that is similar, but not identical, to popen(3). This capability is primarily provided by the child_process.spawn() function: const spawn = require('child_process').spawn; const ls = spawn('ls', ['-lh', '/usr']); ls.stdout.on('data', (data) => { console.log(`stdout: ${data}`); }); ls.stderr.on('data', (data) => { console.log(`stderr: ${data}`); }); ls.on('close', (code) => {

fs.Stats

Class: fs.Stats Objects returned from fs.stat(), fs.lstat() and fs.fstat() and their synchronous counterparts are of this type. stats.isFile() stats.isDirectory() stats.isBlockDevice() stats.isCharacterDevice() stats.isSymbolicLink() (only valid with fs.lstat()) stats.isFIFO() stats.isSocket() For a regular file util.inspect(stats) would return a string very similar to this: { dev: 2114, ino: 48064969, mode: 33188, nlink: 1, uid: 85, gid: 100, rdev: 0, size: 527, blksize:

process.umask()

process.umask([mask]) Sets or reads the process's file mode creation mask. Child processes inherit the mask from the parent process. Returns the old mask if mask argument is given, otherwise returns the current mask. const newmask = 0o022; const oldmask = process.umask(newmask); console.log( `Changed umask from ${oldmask.toString(8)} to ${newmask.toString(8)}` );