6.0.1 • Published 4 months ago
detective-cjs v6.0.1
detective-cjs
Get the dependencies of a CommonJS module by traversing its AST
npm install detective-cjs
But dude, substack already built this: node-detective. Yes, but I needed the capability to reuse an AST and this was unlikely to be merged timely. I can also support jsx and other syntactic constructs faster.
Usage
const fs = require('fs');
const detective = require('detective-cjs');
const mySourceCode = fs.readFileSync('myfile.js', 'utf8');
// Pass in a file's content or an AST
const dependencies = detective(mySourceCode);
- Supports JSX, ES7, and any other features that node-source-walk supports.
License
6.0.1
4 months ago
6.0.0
1 year ago
5.0.1
2 years ago
5.0.0
2 years ago
4.1.0
2 years ago
4.0.0
3 years ago
3.1.3
3 years ago
3.1.2
3 years ago
3.1.1
7 years ago
3.1.0
7 years ago
3.0.0
7 years ago
2.0.1
7 years ago
2.0.0
9 years ago
1.0.5
10 years ago
1.0.4
10 years ago
1.0.3
10 years ago
1.0.2
10 years ago
1.0.1
11 years ago
1.0.0
11 years ago