This CLI tool tests if a given package has been installed from a given origin.
Example:
npx @pqina/package-has-origin @pqina/pintura npm.pqina.nl
If @pqina/pintura
wasn't installed from npm.pqina.nl
the script exits with an error.
This can be used as a prebuild
script to make sure a certain package is installed before running build.
{
"scripts": {
"prebuild": "npx @pqina/package-has-origin @pqina/pintura npm.pqina.nl",
"build": "echo \"Running build\" && exit 1"
}
}
Tested with Npm, Yarn 2+, and Pnpm.