Socket
Socket
Sign inDemoInstall

npm-install-checks

Package Overview
Dependencies
1
Maintainers
6
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    npm-install-checks

Check the engines and platform fields in package.json


Version published
Maintainers
6
Install size
124 kB
Created

Changelog

Source

5.0.0 (2022-04-05)

⚠ BREAKING CHANGES

  • this drops support for node 10 and non-LTS versions of node 12 and node 14

Dependencies

  • @npmcli/template-oss@3.2.2 (45e7fd5)

v4.0

  • Remove checkCycle and checkGit, as they are no longer used in npm v7
  • Synchronous throw-or-return API instead of taking a callback needlessly
  • Modernize code and drop support for node versions less than 10

v3 2016-01-12

  • Change error messages to be more informative.
  • checkEngine, when not in strict mode, now calls back with the error object as the second argument instead of warning.
  • checkCycle no longer logs when cycle errors are found.

v2 2015-01-20

  • Remove checking of engineStrict in the package.json

Readme

Source

npm-install-checks

Check the engines and platform fields in package.json

API

Both functions will throw an error if the check fails, or return undefined if everything is ok.

Errors have a required and current fields.

.checkEngine(pkg, npmVer, nodeVer, force = false)

Check if node/npm version is supported by the package. If it isn't supported, an error is thrown.

force argument will override the node version check, but not the npm version check, as this typically would indicate that the current version of npm is unable to install the package properly for some reason.

Error code: 'EBADENGINE'

.checkPlatform(pkg, force)

Check if OS/Arch is supported by the package.

Error code: 'EBADPLATFORM'

Keywords

FAQs

Last updated on 05 Apr 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc