Have ideas to improve npm?Join in the discussion! »

js-dependency-viewer

1.0.3 • Public • Published

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:

  1. Required parameter --target="/path/to/application"
  2. Optional parameter --out="result.json" (default: stdout to console)
  3. 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"
        ]}
    ]
}]

Keywords

none

Install

npm i js-dependency-viewer

DownloadsWeekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

48.3 kB

Total Files

16

Last publish

Collaborators

  • avatar