blob: 074dc6074f8fe434744abc9cdebae20d664dcc4b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
Flora Colossus
-----------
> Walk your node_modules tree
## Installation
```bash
npm i --save-dev flora-colossus
```
## API
### Enum: `DepType`
```js
import { DepType } from 'flora-colossus';
// DepType.PROD --> Production dependency
// DepType.OPTIONAL --> Optional dependency
// DepType.DEV --> Development dependency
// DepType.DEV_OPTIONAL --> Optional dependency of a development dependency
// DepType.ROOT --> The root module
```
####
### Class: `Walker`
```js
import { Walker } from 'flora-colossus';
// modulePath is the root folder of your module
const walker = new Walker(modulePath);
```
#### `walker.walkTree()`
Returns `Promise<Module[]>`
Will walk your entire node_modules tree reporting back an array of "modules", each
module has a "path", "name" and "depType". See the typescript definition file
for more information.
|