mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-04-21 08:59:07 +00:00
24 lines
636 B
Markdown
24 lines
636 B
Markdown
![]() |
### detective-es6 [](https://npmjs.org/package/detective-es6) [](https://npmjs.org/package/detective-es6)
|
||
|
|
||
|
> Get the dependencies of an ES6 module
|
||
|
|
||
|
`npm install detective-es6`
|
||
|
|
||
|
### Usage
|
||
|
|
||
|
```js
|
||
|
var detective = require('detective-es6');
|
||
|
|
||
|
var mySourceCode = fs.readFileSync('myfile.js', 'utf8');
|
||
|
|
||
|
// Pass in a file's content or an AST
|
||
|
var dependencies = detective(mySourceCode);
|
||
|
|
||
|
```
|
||
|
|
||
|
* Supports JSX, Flow, and any other features that [node-source-walk](https://github.com/mrjoelkemp/node-source-walk) supports.
|
||
|
|
||
|
#### License
|
||
|
|
||
|
MIT
|