process.chdir()

process.chdir(directory) Changes the current working directory of the process or throws an exception if that fails. console.log(`Starting directory: ${process.cwd()}`); try { process.chdir('/tmp'); console.log(`New directory: ${process.cwd()}`); } catch (err) { console.log(`chdir: ${err}`); }

process.argv

process.argv An array containing the command line arguments. The first element will be 'node', the second element will be the name of the JavaScript file. The next elements will be any additional command line arguments. // print process.argv process.argv.forEach((val, index, array) => { console.log(`${index}: ${val}`); }); This will generate: $ node process-2.js one two=three four 0: node 1: /Users/mjr/work/node/process-2.js 2: one 3: two=three 4: four

process.connected

process.connected <Boolean> Set to false after process.disconnect() is called If process.connected is false, it is no longer possible to send messages.

process.abort()

process.abort() This causes Node.js to emit an abort. This will cause Node.js to exit and generate a core file.

process.arch

process.arch What processor architecture you're running on: 'arm', 'ia32', or 'x64'. console.log('This processor architecture is ' + process.arch);

pipe event (stream.Writable)

Stability: 2 - Stable A stream is an abstract interface implemented by various objects in Node.js. For example a request to an HTTP server is a stream, as is process.stdout. Streams are readable, writable, or both. All streams are instances of EventEmitter. You can load the Stream base classes by doing require('stream'). There are base classes provided for Readable streams, Writable streams, Duplex streams, and Transform streams. This document is split up into 3 sections: The first section e

path.win32

path.win32 Provide access to aforementioned path methods but always interact in a win32 compatible way.

path.sep

path.sep The platform-specific file separator. '\\' or '/'. An example on *nix: 'foo/bar/baz'.split(path.sep) // returns ['foo', 'bar', 'baz'] An example on Windows: 'foo\\bar\\baz'.split(path.sep) // returns ['foo', 'bar', 'baz']

pause event (Readline)

Event: 'pause' function () {} Emitted whenever the input stream is paused. Also emitted whenever the input stream is not paused and receives the SIGCONT event. (See events SIGTSTP and SIGCONT) Example of listening for 'pause': rl.on('pause', () => { console.log('Readline paused.'); });

path.resolve()

path.resolve([from ...], to) Resolves to to an absolute path. If to isn't already absolute from arguments are prepended in right to left order, until an absolute path is found. If after using all from paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory. Non-string from arguments are ignored. Another way to think of it is as a sequence of cd c