🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

only-allow-engines

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

only-allow-engines

Force a specific package manager and node version to be used on a project

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

only-allow-engines

Force a specific package manager and node version to be used on a project

Usage 1

1. Install

npm i only-allow-engines --save

2. Config engines

Add the engines field to your package.json, like this:

 "engines": {
    "node": ">=16",
    "npm": ">8"
  }

if you want to force pnpm, like this:

"engines": {
    "node": ">=16",
    "pnpm": ">6"
  }

you can read more about engines in the npm docs

3. Add script to your package.json

{
  "scripts": {
    "preinstall": "npx only-allow-engines"
  }
}

Usage 2

const onlyAllowEngines = require('only-allow-engines');

onlyAllowEngines({
  pnpm: ">=6",
  node: ">=16.0.0",
})

Keywords

only-allow

FAQs

Package last updated on 25 Jun 2022

Did you know?

Socket

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