1.0.1 • Published 8 years ago

list-broken-requires v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

list-broken-requires

experimental

A command-line tool to find broken require and import paths in a source directory. For example, when you are requiring a file which has been moved or deleted.

For example, if you have a src folder with the following indx.js

// points to a file that does not exist
const a = require('./some/broken/path.js')

// also looks for ES6 imports
import './another/broken/path.js'

// a valid file
import './does-exist.js'

Now, we can run the tool on our src directory:

list-broken-requires src

Output:

/path/to/src/index.js
  './some/broken/path.js'  
  './another/broken/path.js'

Broken requires: 2

Install

npm install -g list-broken-requires

Usage

CLI

Usage:
  list-broken-requires [dir]

Where dir defaults to the current working directory.

See Also

License

MIT, see LICENSE.md for details.