require-detective

find require() calls in commonjs modules, quickly, using webassembly

OTHER License

Stars
8
Committers
2

require-detective

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

Node.js Installation

npm install detective-wasm

Node.js Usage

var detective = require('detective-wasm')

var requires = detective(`
  var a = require('a')
  var b = /**/require//
  (   "b");
`)
// → ['a', 'b']

Rust Installation

Add to Cargo.toml:

[dependencies]
require-detective = "^0.1.0"

Rust Usage

Please see docs.rs.

License

Apache-2.0 The tests in test/ originate from detective, MIT license.