chrisdrakeford 9c87c1307d first commit | há 3 anos atrás | |
---|---|---|
.. | ||
index.d.ts | há 3 anos atrás | |
index.js | há 3 anos atrás | |
license | há 3 anos atrás | |
package.json | há 3 anos atrás | |
readme.md | há 3 anos atrás |
Check if your package was installed globally
Can be useful if your CLI needs different behavior when installed globally and locally.
$ npm install is-installed-globally
const isInstalledGlobally = require('is-installed-globally');
// With `npm install your-package`
console.log(isInstalledGlobally);
//=> false
// With `npm install --global your-package`
console.log(isInstalledGlobally);
//=> true