Skip to content

Commit

Permalink
fix: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dword-design committed Mar 9, 2021
1 parent 66b8793 commit c9b3e18
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,19 @@ $ yarn add depcheck-detector-execa
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:

```js
import depcheck from 'depcheck'
import execaDetector from 'depcheck-detector-execa'
const depcheck = require('depcheck')
const execaDetector = require('depcheck-detector-execa')

const options = {
detectors: [
execaDetector,
],
}

depcheck('/path/to/your/project', options, (unused) => {
depcheck(process.cwd(), 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
})
Expand Down

0 comments on commit c9b3e18

Please sign in to comment.