https://github.com/lsongdev/deps-parser
A simple way to get module dependencies
https://github.com/lsongdev/deps-parser
dependencies es6 javascript module-system
Last synced: 7 months ago
JSON representation
A simple way to get module dependencies
- Host: GitHub
- URL: https://github.com/lsongdev/deps-parser
- Owner: lsongdev
- Created: 2018-05-08T08:18:03.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-07-17T05:57:30.000Z (over 6 years ago)
- Last Synced: 2025-09-06T07:52:30.600Z (7 months ago)
- Topics: dependencies, es6, javascript, module-system
- Language: JavaScript
- Homepage: https://npmjs.org/deps-parser
- Size: 2.93 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# deps-parser
A simple way to get module dependencies
## Install
```bash
~$ npm install deps-parser
```
## Example
Suppose you have 2 files, one is `a.js` with content:
```js
var b = require('./b')
```
another is `b.js` whose content is:
```js
var c = require('./c');
```
Below is how we get the dependencies list of `a.js`:
```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.