File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ npm install --save-dev @11ty/dependency-tree
17
17
## Features
18
18
19
19
* Ignores ` node_modules `
20
+ * Or, use ` nodeModuleNamesOnly ` to return a list of node_modules packages.
20
21
* Ignores Node’s built-ins (e.g. ` path ` )
21
22
* Handles circular dependencies (Node does this too)
22
23
@@ -48,4 +49,15 @@ DependencyTree("./this-does-not-exist.js"); // throws an error
48
49
49
50
DependencyTree (" ./this-does-not-exist.js" , { allowNotFound: true });
50
51
// returns []
52
+ ```
53
+
54
+ ### ` nodeModuleNamesOnly `
55
+
56
+ Navigates all the local files and returns a list of unique package names (not file names) required.
57
+
58
+ ``` js
59
+ const DependencyTree = require (" @11ty/dependency-tree" );
60
+
61
+ DependencyTree (" ./this-does-not-exist.js" , { nodeModuleNamesOnly: true });
62
+ // returns []
51
63
```
You can’t perform that action at this time.
0 commit comments