Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/goto-bus-stop/require-detective
find require() calls in commonjs modules, quickly, using webassembly
https://github.com/goto-bus-stop/require-detective
Last synced: 27 days ago
JSON representation
find require() calls in commonjs modules, quickly, using webassembly
- Host: GitHub
- URL: https://github.com/goto-bus-stop/require-detective
- Owner: goto-bus-stop
- License: other
- Created: 2019-08-16T11:16:27.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-16T04:58:42.000Z (over 1 year ago)
- Last Synced: 2024-10-05T16:26:21.328Z (about 1 month ago)
- Language: Rust
- Homepage:
- Size: 33.2 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# require-detective
find require() calls in commonjs modules, quickly using webassembly
This is a wasm-based alternative to the [detective](https://github.com/browserify/detective) module used in browserify, built on the [RESSA](https://github.com/FreeMasen/RESSA) parser. It can be used as a Rust crate and as a CommonJS module.
Node.js: [Install](#nodejs-installation) - [Usage](#nodejs-usage) - Rust: [Install](#rust-installation) - [Usage](#rust-usage) - [License: Apache-2.0](#license)
[![npm][npm-image]][npm-url]
[![travis][travis-image]][travis-url][npm-image]: https://img.shields.io/npm/v/detective-wasm.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/detective-wasm
[travis-image]: https://img.shields.io/travis/com/goto-bus-stop/require-detective.svg?style=flat-square
[travis-url]: https://travis-ci.com/goto-bus-stop/require-detective## Node.js Installation
```
npm install detective-wasm
```## Node.js Usage
```js
var detective = require('detective-wasm')var requires = detective(`
var a = require('a')
var b = /**/require//
( "b");
`)
// → ['a', 'b']
```## Rust Installation
Add to Cargo.toml:
```toml
[dependencies]
require-detective = "^0.1.0"
```## Rust Usage
Please see [docs.rs](https://docs.rs/require-detective).
## License
[Apache-2.0](LICENSE.md)
The tests in test/ originate from [detective](https://github.com/browserify/detective), MIT license.