Questionnaire-of-the-Facebo.../node_modules/is-installed-globally/index.js

16 lines
346 B
JavaScript
Raw Normal View History

2021-03-11 01:43:28 +00:00
'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;
}
})();