@everymundo/global-root-dir
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "@everymundo/global-root-dir", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Sets a global variable variable __rootdir", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
const fs = require('fs'); | ||
const { globalScope } = require('./lib/global-scope'); | ||
const setGlobalRootDir = (value = '') => { | ||
if (globalScope.__rootdir) return; | ||
const setGlobalRootDir = (value = '', configurable = false, overwrite = false) => { | ||
if (globalScope.__rootdir && !overwrite) return globalScope.__rootdir; | ||
@@ -11,5 +11,7 @@ if (!value) value = process.cwd(); | ||
Object.defineProperty(globalScope, '__rootdir', { value }); | ||
Object.defineProperty(globalScope, '__rootdir', { value, configurable }); | ||
return globalScope.__rootdir; | ||
}; | ||
module.exports = { setGlobalRootDir }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7095
98