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.
- Host: GitHub
- URL: https://github.com/creationix/mine
- Owner: creationix
- Created: 2013-05-01T22:34:25.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2014-08-05T20:03:27.000Z (almost 12 years ago)
- Last Synced: 2025-03-24T04:14:38.658Z (about 1 year ago)
- Language: JavaScript
- Size: 390 KB
- Stars: 17
- Watchers: 7
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
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);
```