1.1.2 • Published 7 years ago

root-paths v1.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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
}
1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago