is-install-needed
This is a simple tool that checks if the lock file has changed (supports Yarn, npm and pnpm) so you know if you need to run install.
Installation
Install globally with npm
, yarn
or pnpm
if you want to use the cli, or locally if you only want to use it programatically.
Usage
CLI
$ is-install-needed
By default it will automatically look for yarn.lock, package-lock.json and shrinkwrap.yaml.
Flag | Description |
---|
--yarn | Only look for yarn.lock |
--npm | Only look for package-lock.json |
--pnpm | Only look for shrinkwrap.yaml |
Programmatic API
import { isInstallNeeded } from 'is-install-needed';
async function check() {
const isNeeded = await isInstallNeeded('./yarn.lock', '.lockhash');
if (result) {
}
}