Skip to content

lsongdev/deps-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

deps-parser

A simple way to get module dependencies

Install

~$ npm install deps-parser

Example

Suppose you have 2 files, one is a.js with content:

var b = require('./b')

another is b.js whose content is:

var c = require('./c');

Below is how we get the dependencies list of a.js:

var Deps = require('deps-parser');
var analyzer = new Deps();
var deps = analyzer.getDeps(__dirname + "/a.js");
console.log(deps); 
// output
[
  '{__dirname}/c.js'
  '{__dirname}/b.js'
]

License

This project is under MIT licence.

About

A simple way to get module dependencies

Topics

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published