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.
yarn and npm have started to diverge in feature set. For example yarn introduced workspaces, which do not work with npm (yet).
To avoid contributors accidentally using the "wrong" package manager and getting hard to debug errors, you can use assert-pm
as a preinstall script. It'll cause the installation to fail and warn the user.
yarn add --dev assert-pm
npm install --dev assert-pm
If you are managing your packages with workspaces, you can add it to your parent package.json as preinstall script. Make sure to not add it to packages you do publish as this script will also be run upon installation by users.
"scripts": {
"preinstall": "assert-pm yarn --message"
}
If anyone now runs
npm install
they will get an error:
pmtest@1.0.0 preinstall
> assert-pm yarn
Please use yarn.
npm ERR! code ELIFECYCLE
assert-pm package-manager --message "We are managing our packages using yarn workspaces. Therefore this project requires yarn to install packages."
FAQs
Assert that a certain package manager was used when running a yarn/npm script.
We found that assert-pm 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.