Skip to content

Get the dependencies of a CommonJS module by traversing its AST

License

Notifications You must be signed in to change notification settings

nicolas6422/node-detective-cjs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

detective-cjs npm npm

Get the dependencies of an CommonJS module

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

var detective = require('detective-cjs');

var mySourceCode = fs.readFileSync('myfile.js', 'utf8');

// Pass in a file's content or an AST
var dependencies = detective(mySourceCode);

License

MIT

About

Get the dependencies of a CommonJS module by traversing its AST

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%