initial commit - far from runnable
This commit is contained in:
commit
db057ce342
8614 changed files with 1032171 additions and 0 deletions
30
node_modules/app-root-path/lib/app-root-path.js
generated
vendored
Normal file
30
node_modules/app-root-path/lib/app-root-path.js
generated
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
'use strict';
|
||||
|
||||
module.exports = function(dirname) {
|
||||
var path = require('path');
|
||||
var resolve = require('./resolve.js');
|
||||
var appRootPath = resolve(dirname);
|
||||
|
||||
var publicInterface = {
|
||||
resolve: function(pathToModule) {
|
||||
return path.join(appRootPath, pathToModule);
|
||||
},
|
||||
|
||||
require: function(pathToModule) {
|
||||
return require(publicInterface.resolve(pathToModule));
|
||||
},
|
||||
|
||||
toString: function() {
|
||||
return appRootPath;
|
||||
},
|
||||
|
||||
setPath: function(explicitlySetPath) {
|
||||
appRootPath = path.resolve(explicitlySetPath);
|
||||
publicInterface.path = appRootPath;
|
||||
},
|
||||
|
||||
path: appRootPath
|
||||
};
|
||||
|
||||
return publicInterface;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue