JSPM

reveal-unused

0.3.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q26211F
  • License Apache-2.0

A module which reports unused variables in your code.

Package Exports

  • reveal-unused
  • reveal-unused/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (reveal-unused) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

reveal unused

Identify unused variables in your javascript code.

cli

reveal-unused works with single files, directories or listed files

$ reveal-unused /path/to/file.js
$ reveal-unused /path/to/file.js /path/to/file2.js /path/to/file3.js
$ reveal-unused /dir

--ignore-params

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

$ reveal-unused /path/to/file.js --ignore-params req,res,_

api

unused(src)

src is a string of file contents

unused(fs.readFileSync(filePath, 'utf8'))

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
}

install

yarn global add reveal-unused
npm i -g reveal-unused

License

Library is distributed under the Apache license.