Identify unused variables in your javascript code.
$ unused /path/to/file.js
Comma separated list of function parameters to ignore during unused checks. You often want to know when you forgot to handle err
or other parameters, but sometimes you have placeholders (req
, res
, etc) which you might want to ignore
$ unused /path/to/file.js --ignore-params req,res,_
src is a javascript source string
Returns an array of objects specifying the name, location, and if the variable is a function parameter
{
name: 'foo',
loc: {
line: 1,
column: 1,
},
param: true || false
}
npm install unused
Library is distributed under the Apache license.