detective icon indicating copy to clipboard operation
detective copied to clipboard

Find all calls to require() no matter how deeply nested using a proper walk of the AST

Results 12 detective issues
Sort by recently updated
recently updated
newest added

If a function expression declares a `require` parameter, its body is not analyzed for `require()` calls. This is mostly helpful for bundles that were already browserified, `detective` will ignore the...

Closes https://github.com/browserify/detective/issues/88

After encountering dependency-check-team/dependency-check#112 I tried looking into how that project uses `detective` and the various "extensions", such as [detective-typescript](https://github.com/pahen/detective-typescript) that enabled foreign syntax. It was not immediately obvious how this...

Currently detective parses these as valid requires even though they are not. ``` javascript require('b') // require('c') /* require('d') */ ``` maybe with https://github.com/jonschlinkert/strip-comments

Add a `findFast` function that's exactly like `detective.find`, but doesn't parse the source. detective.find automatically uses findFast if possible. we cannot do this if a custom `isRequire` function is provided,...

Hi, I came across a problem when `node-detective` cannot operate on ES2015+ source code. This is not a problem solely related to this package. The same problem applies to `node-syntax-error`...

Eg: ``` var require = function() { console.log('test') } require("this isn't a dependency") ``` It should be pretty simple to detect scopes in which require is redefined and exclude requires...

Tried this: ``` javascript import detective from 'detective'; import fs from 'fs'; let src = fs.readFileSync(__filename); let requires = detective(src, { parse: { ecmaVersion: 6, sourceType: 'module' } }); console.log(requires);...

@zertosh What do you think about reverting the regex optimization so that syntax-error can be removed upstream? Giant libraries with no require calls should be noParse'd anyway, and the performance...

It would be nice to know that there was a require that could not be parsed rather than it being ignored. ``` var reqStr = './some-thing' ; require(reqStr); ```