Skip to content

youviewtv/node-installed-check-core

 
 

Repository files navigation

installed-check-core

Checks that the installed modules fulfill the requirements of package.json, both when it comes to the version ranges of the modules themselves and when it comes to the version range of their engine requirements.

npm version npm downloads Module type: ESM Types in JS js-semistandard-style Follow @voxpelli@mastodon.social

Exists as a CLI as well: installed-check

Usage

import { installedCheck } from 'installed-check-core';

const { errors } = await installedCheck({ versionCheck: true });

if (result.errors.length) {
  console.error('Dependency errors: \n\n' + result.errors.join('\n') + '\n');
}

In CommonJS using available import() expression

const { installedCheck } = await import('installed-check-core');

Syntax

const { errors, warnings, notices } = await installedCheck({
  path: 'path/to/module',
  engineCheck: true,
  engineIgnores: ['foo'],
  engineNoDev: true,
  versionCheck: true,
});

Parameters

  1. options – optional object containing additional options for the module

Returns

A Promise resolving to:

{
  notices: ['123'],
  warnings: ['Abc'],
  errors: ['Xyz']
};

Options

  • path – defaults to .. Specifies the path to where the target to be checked can be found, with its package.json being there and its node_modules as well.
  • engineCheck – if set installed-check will check that the installed modules comply with the engines requirements of the package.json and suggest an alternative requirement if the installed modules don't comply.
  • engineIgnores – if set then the specified module names won't be included in the engine check. engineIgnores should an array of module names while the CLI flags should be set once for each module name.
  • engineNoDev – if set then dev dependencies won't be included in the engine check.
  • versionCheck – if set installed-check will check that the installed modules comply with the version requirements set for them the package.json.

About

Checks whether installed modules fulfills the requirements of package.json

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.6%
  • Shell 0.4%