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.
Exists as a CLI as well: installed-check
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');const { errors, warnings, notices } = await installedCheck({
path: 'path/to/module',
engineCheck: true,
engineIgnores: ['foo'],
engineNoDev: true,
versionCheck: true,
});options– optional object containing additional options for the module
A Promise resolving to:
{
notices: ['123'],
warnings: ['Abc'],
errors: ['Xyz']
};path– defaults to.. Specifies the path to where the target to be checked can be found, with itspackage.jsonbeing there and itsnode_modulesas well.engineCheck– if setinstalled-checkwill check that the installed modules comply with the engines requirements of thepackage.jsonand 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.engineIgnoresshould 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 setinstalled-checkwill check that the installed modules comply with the version requirements set for them thepackage.json.