root-paths
v1.1.2
Published
app paths, root paths
Downloads
8
Readme
Paths
Node
npm i root-paths --save
Project
project
├── a
│ ├── a.js
│ └── c
│ └── c.js
├── b
│ └── b.js
└── ins.js
Usage
// ins.js
const Paths = require('root-paths')
global.paths = new Paths(__dirname)
require(paths.a.a) == require('./a/a')
require(paths.b.b) == require('./b/b')
require(paths.a.c.c) == require('./a/c/c')
Options
{
root: __dirname, // 项目根目录
folders: [], // 执行要查询的子目录
filter: ['**/node_modules/**'] // 过滤条件,请参考 glob
}