Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
npm-only-allow
Advanced tools
The hook about preinstall of
npm
behaves inconsistently across package managers.
The existing solution (
only-allow
) is not working well.
The
npm-only-allow
goal is to fix them.
yarn add npm-only-allow
Add a postinstall
script to your project's package.json
.
If you want to force npm|cnpm|pnpm|yarn
, add:
(If you want to smooth out the difference, you also need to add it in the startup script)
{
"scripts": {
"postinstall": "npm-only-allow --PM yarn --server install",
"start": "npm-only-allow --server start && vite server or other"
}
}
Set the package manager
Specifies whether to run in the 'postinstall' or 'start' phase
Set the language category for error messages to be output , Default to Chinese
node v14.19.0
npm v8.11.0
yarn v1.22.19
pnpm v7.2.7
cnpm v9.0.1
This is the testing process after the development is complete
You just have to choose one or the other
Let's take cnpm
for example
{
"scripts": {
"postinstall": "npm-only-allow --PM cnpm --server install",
"start": "npm-only-allow --server start"
}
}
pnpm
i | yarn
add | npm
icnpm
icnpm
i lodashcnpm
startyarn
add momentcnpm
startpnpm
i jquerycnpm
startpnpm
uninstall jquerycnpm
startFAQs
Specification package manager
We found that npm-only-allow demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.