js-dependency-viewer
v1.0.3
Published
A simple tool to find all external dependencies of your project.
Downloads
4
Readme
JS Dependency Viewer
A simple tool to find all external dependencies of your project.
How to install:
Globally
npm install -g js-dependency-viewer
Then you can run from your terminal with parameters:
- Required parameter
--target="/path/to/application"
- Optional parameter
--out="result.json"
(default: stdout to console) - Optional parameter
--ext="extension1,extension2,extension3"
(default:['.vue', '.js', '.ts', '.js6', '.es6']
)
jdv --target="/path/to/application" --out="result.json"
Locally:
npm install --save js-dependency-viewer
const jdv = require('js-dependency-viewer');
jdv.find('/path/to/application').then((dependencyObject) => {
// ...
});
Output:
[{
"module": "debounce",
"size": 11.3,
"methods": [{
"name": "debounce",
"location": [
"target\\src\\component1.vue",
"target\\src\\component2.vue",
"target\\src\\component3.vue"
]
}]
}, {
"module":"lodash",
"size": 1361.92,
"methods":[
{
"name":"get",
"location":[
"target\\src\\file1.ts",
"target\\src\\file2.ts"
]},
{
"name":"each",
"location":[
"target2\\src\\file3.ts"
]}
]
}]