Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/voxpelli/node-installed-check

Checks that all dependencies in your package.json have supported versions installed and complies with your specified node engine version range
https://github.com/voxpelli/node-installed-check

cli dependency-analysis hacktoberfest npm package-json validation versioning

Last synced: 29 days ago
JSON representation

Checks that all dependencies in your package.json have supported versions installed and complies with your specified node engine version range

Lists

README

        


installed-check

[![npm version](https://img.shields.io/npm/v/installed-check.svg?style=flat)](https://www.npmjs.com/package/installed-check)
[![npm downloads](https://img.shields.io/npm/dm/installed-check.svg?style=flat)](https://www.npmjs.com/package/installed-check)
[![dependents](https://img.shields.io/librariesio/dependents/npm/installed-check?style=flat)](https://libraries.io/npm/installed-check)
[![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg)](https://github.com/voxpelli/eslint-config)
[![Follow @[email protected]](https://img.shields.io/mastodon/follow/109247025527949675?domain=https%3A%2F%2Fmastodon.social&style=social)](https://mastodon.social/@voxpelli)

Verifies that installed modules comply with the requirements specified in `package.json`.

By default checks engine ranges, peer dependency ranges and installed versions and, in mono-repos using workspaces, by default checks all workspaces as well as the workspace root.

## Usage

### Command line

```sh
npm install -g installed-check
```

Then run it at the root of your project to validate the installed dependencies:

```sh
installed-check
```

### As npm script

```sh
npm install --save-dev installed-check
```

```json
"scripts": {
"test": "installed-check"
}
```

### Programmatic use

Use [installed-check-core](https://github.com/voxpelli/node-installed-check-core)

## Checks

* `--engine-check` / `-e` – if set `installed-check` will check that the installed modules doesn't have stricter [`engines`](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#engines) ranges than those in the `package.json` and suggests an alternative requirement if they do. If set, the default checks will be overriden.
* `--peer-check` / `-p` – if set `installed-check` will check that the installed modules doesn't have stricter [`peerDependencies`](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#peerdependencies) ranges than those in the `package.json` and suggests an alternative requirement if they do. If set, the default checks will be overriden.
* `--version-check` / `-c` – if set `installed-check` will check that the installed modules comply with the version requirements set for them the `package.json`. If set, the default checks will be overriden.

## Check options

* `--ignore ARG` / `-i ARG` – excludes the named dependency from non-version checks. Supports [`picomatch`](https://www.npmjs.com/package/picomatch) globbing syntax, eg. `@types/*` (but be sure to provide the pattern in a way that avoids your shell from matching it against files first)
* `--ignore-dev` / `-d` – if set then dev dependencies won't be included in the non-version checks.
* `--strict` / `-s` – treats warnings as errors

## Fix options
* `--fix` – tries to apply all suggestions and write them back to disk

## Workspace options

* `--no-include-workspace-root` – excludes the workspace root package. Negated equivalent of npm's [`--include-workspace-root`](https://docs.npmjs.com/cli/v10/commands/npm-run-script#include-workspace-root)
* `--no-workspaces` – excludes workspace packages. Negated equivalent of npm's [`--workspaces`](https://docs.npmjs.com/cli/v10/commands/npm-run-script#workspaces)
* `--workspace=ARG` / `-w ARG` – excludes all workspace packages not matching these names / paths. Equivalent to npm's [`--workspace` / `-w`](https://docs.npmjs.com/cli/v10/commands/npm-run-script#workspace)
* `--workspace-ignore=ARG` – xcludes the specified paths from workspace lookup. (Supports globs)

### Additional command line options

* `--debug` – prints debug info
* `--verbose` / `-v` – prints warnings and notices
* `--help` / `-h` – prints help and exits
* `--version` – prints current version and exits

## Similar modules

* [`knip`](https://github.com/webpro/knip) – finds unused files, dependencies and exports in your JavaScript and TypeScript projects – a great companion module to `installed-check`