An open API service indexing awesome lists of open source software.

https://github.com/creationix/mine

Miner digs into a javascript file looking for require calls. Used to statically extract common js dependencies.
https://github.com/creationix/mine

Last synced: about 1 year ago
JSON representation

Miner digs into a javascript file looking for require calls. Used to statically extract common js dependencies.

Awesome Lists containing this project

README

          

mine.js
=======

The mine script accepts js source and returns all the require call locations as well as the target string. This is a submodule of [js-linker](https://github.com/creationix/js-linker) and [my-filters](https://github.com/creationix/my-filters).

``` js
var mine = require('js-linker/mine.js');
var fs = require('fs');
var code = fs.readFileSync("test.js");
var deps = mine(code);
```