2.0.1 • Published 5 years ago
has-process v2.0.1
has-process
Check if the Node.js process exists. Optionally ensures process has a given property, either generically (by comparing against undefined) or through a custom comparator.
Available as ES2015 and CommonJS modules.
Usage
import hasProcess from 'has-process';
// true if process and process.versions are defined
hasProcess();
// true if process and process.nextTick are defined
hasProcess('nextTick')
// true if process and process.nextTick are defined, and process.nextTick is a function
hasProcess((p: NodeJs.Process) => typeof p.nextTick === 'function')