find require() calls in commonjs modules, quickly using webassembly
This is a wasm-based alternative to the detective module used in browserify, built on the RESSA parser. It can be used as a Rust crate and as a CommonJS module.
Node.js: Install - Usage - Rust: Install - Usage - License: Apache-2.0
npm install detective-wasm
var detective = require('detective-wasm')
var requires = detective(`
var a = require('a')
var b = /**/require//
( "b");
`)
// → ['a', 'b']
Add to Cargo.toml:
[dependencies]
require-detective = "^0.1.0"
Please see docs.rs.
Apache-2.0 The tests in test/ originate from detective, MIT license.