2.0.0 • Published 5 years ago
is-cli v2.0.0
is-cli
Returns true if the current module was ran directly by node and not imported by another module. This is useful for CLI-style modules that also export values.
Usage
npm i is-cliconst isCLI = require("is-cli")(module);
// => trueWill throw when module is absent.
© silverwind, distributed under BSD licence