1.0.1 • Published 10 years ago
list-broken-requires v1.0.1
list-broken-requires
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 srcOutput:
/path/to/src/index.js
'./some/broken/path.js'
'./another/broken/path.js'
Broken requires: 2Install
npm install -g list-broken-requiresUsage
CLI
Usage:
list-broken-requires [dir]Where dir defaults to the current working directory.
See Also
License
MIT, see LICENSE.md for details.