From 383285ecd5292bf9a825e05904955b937de84cc9 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sat, 4 Jun 2022 08:51:01 +0200 Subject: Initial commit --- node_modules/is-installed-globally/index.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 node_modules/is-installed-globally/index.js (limited to 'node_modules/is-installed-globally/index.js') diff --git a/node_modules/is-installed-globally/index.js b/node_modules/is-installed-globally/index.js new file mode 100644 index 0000000..7fefcda --- /dev/null +++ b/node_modules/is-installed-globally/index.js @@ -0,0 +1,15 @@ +'use strict'; +const fs = require('fs'); +const globalDirs = require('global-dirs'); +const isPathInside = require('is-path-inside'); + +module.exports = (() => { + try { + return ( + isPathInside(__dirname, globalDirs.yarn.packages) || + isPathInside(__dirname, fs.realpathSync(globalDirs.npm.packages)) + ); + } catch { + return false; + } +})(); -- cgit