npm-only-allow
Advanced tools
Comparing version 1.1.5 to 1.2.2
@@ -28,5 +28,7 @@ #!/usr/bin/env node | ||
// which script running | ||
const script = process.env.npm_lifecycle_script; | ||
const server = script.includes(ctx.config.PM) ? "install" : "start"; | ||
const script = process.argv; | ||
const server = script.includes('--PM') ? "install" : "start"; | ||
console.log(process.env) | ||
// do : start or install | ||
@@ -33,0 +35,0 @@ if (server === "install") { |
{ | ||
"name": "npm-only-allow", | ||
"version": "1.1.5", | ||
"version": "1.2.2", | ||
"description": "Specification package manager", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -8,5 +8,5 @@ # npm-only-allow | ||
# usage | ||
# Usage | ||
Add a `postinstall` script to your project's `package.json`. | ||
Add a `preinstall` script to your project's `package.json`. | ||
@@ -19,3 +19,3 @@ If you want to force `npm|cnpm|pnpm|yarn`, add: | ||
"scripts": { | ||
"postinstall": "npx npm-only-allow@latest --PM yarn", | ||
"preinstall": "npx npm-only-allow@latest --PM yarn", | ||
"start": "npx npm-only-allow@latest && vite" | ||
@@ -26,3 +26,3 @@ } | ||
# params | ||
# Params | ||
* PM | ||
@@ -40,3 +40,3 @@ > Set the package manager | ||
# tips | ||
# Tips | ||
If you are using 'cnpm' as your package manager, try pressing the space bar if loading is going on | ||
@@ -54,3 +54,3 @@ | ||
"scripts": { | ||
"postinstall": "npx npm-only-allow@latest --PM yarn", | ||
"preinstall": "npx npm-only-allow@latest --PM yarn", | ||
"start": "npx npm-only-allow@latest && vite" | ||
@@ -112,3 +112,3 @@ } | ||
/** | ||
* cnpm i jquery | pnpm i jquery | cnpm i jquery | ||
* cnpm i jquery | pnpm i jquery | npm i jquery | ||
* => 关闭正在运行的线程 | ||
@@ -115,0 +115,0 @@ * => [npm-only-allow]:检测到您可能使用了不匹配的包管理器安装了依赖(jquery),请卸载或使用正确的管理器安装后重试 |
Unpublished package
Supply chain riskPackage version was not found on the registry. It may exist on a different registry and need to be configured to pull from that registry.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
526
19094
1