JSPM

  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q52813F
  • License

CLI tool that tells you when dependencies are missing from package.json and offers you a choice to install them. Also tells you when dependencies are listed in package.json but are not being used anywhere in your project. Node.js command line tool and API.

Package Exports

  • lint-deps

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 (lint-deps) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

lint-deps NPM version

CLI tool that tells you when dependencies are missing from package.json and offers you a choice to install them. Also tells you when dependencies are listed in package.json but are not being used anywhere in your project. Node.js command line tool and API.

Install globally with npm:

npm i -g lint-deps

API

var deps = require('lint-deps');

// pass the directory to scan
console.log(deps('lib'));

Manually define dependencies

When dependencies are defined in a format that isn't recognized by lint-deps, like with grunt tasks (e.g. grunt.loadNpmTasks()), you can manually specify these dependencies in code comments, similar to jshint commands.

Example:

Make sure deps is the first thing, and pass a space separated list of module names:

/** deps: foo bar baz */

If you use verb, you can use HTML code comments in your .verb.md file:

{%= reflinks() %}
<!-- deps: helper-reflinks -->

CLI

In the command line, run:

deps

Commands

  • -r | --report: save a report to disk. By default report.json is saved. To change the path do: -r foo.json
  • -e | --exclude: comma-separated list of files or directories to exclude. Example: deps -e test,lib

Examples

If everything is good, you'll see something like this:

image

Install missing packages

If packages are missing, you'll see a prompt like this (also shows which files require the package):

image

If you choose yes:

image

choose dependencies

Works the same way for devDependencies:

image

choose "nothing, just install"

image

Now hit enter and everything that was checked will be installed.

If you choose no:

image

Done.

Author

Jon Schlinkert

License

Copyright (c) 2015 Jon Schlinkert
Released under the MIT license


This file was generated by verb on February 05, 2015.