is-install-needed
This is a simple tool that checks if the lock file has changed (supports both Yarn and npm) so you know if you need to run install.
Installation
npm
$ npm install -g is-install-needed
yarn
$ yarn global add is-install-needed
Usage
CLI
$ is-install-needed
By default it looks for both yarn.lock and package-lock.json.
Flag | Description |
---|
--yarn | Only look for yarn.lock |
--npm | Only look for package-lock.json |
Programmatic API
import { isInstallNeeded } from 'is-install-needed';
async function check() {
const isNeeded = await isInstallNeeded('./yarn.lock', '.lockhash');
if (result) {
}
}