Socket
Socket
Sign inDemoInstall

npm-install-checks

Package Overview
Dependencies
3
Maintainers
5
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
Weekly downloads
7.1M
increased by2.41%
Maintainers
5
Install size
127 kB
Created
Weekly downloads
 

Changelog

Source

6.3.0 (2023-10-06)

Features

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 a package's engines.node and engines.npm match the running system.

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, environment)

Check if a package's os, cpu and libc match the running system.

force argument skips all checks.

environment overrides the execution environment which comes from process.platform process.arch and current libc environment by default. environment.os environment.cpu and environment.libc are available.

Error code: 'EBADPLATFORM'

Keywords

FAQs

Last updated on 06 Oct 2023

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