Match JS file's all dependencies.
npm install deps-matcher;
const DepsMatcher = require('deps-matcher');
const matches = new DepsMatcher([
path.join(__dirname, '../lib/index.js'),
path.join(__dirname, '../lib/index.css')
].filter(DepsMatcher.isJSFile));
console.log(JSON.stringify(matches, null, 2));
- Promise the input are absolute path;
MIT Lisence.