Detector for depcheck that finds dependencies in execa calls.
# NPM
$ npm install depcheck-execa-detector
# Yarn
$ yarn add depcheck-execa-detector
Custom detectors are currently only supported when using depcheck
via the Node.js API. Simply add the detector to your depcheck config and run depcheck:
import depcheck from 'depcheck'
import execaDetector from 'depcheck-execa-detector'
const options = {
detectors: [
execaDetector,
],
}
depcheck('/path/to/your/project', options, (unused) => {
console.log(unused.dependencies); // an array containing the unused dependencies
console.log(unused.devDependencies); // an array containing the unused devDependencies
console.log(unused.missing); // a lookup containing the dependencies missing in `package.json` and where they are used
console.log(unused.using); // a lookup indicating each dependency is used by which files
console.log(unused.invalidFiles); // files that cannot access or parse
console.log(unused.invalidDirs); // directories that cannot access
})
The detector detects calls like
import execa from 'execa'
execa('foo')
execa('foo', ['--verbose'])
execa.command('foo bar')
Unless stated otherwise all works are:
Copyright © Sebastian Landwehr info@dword-design.de
and licensed under: