ld-check-dependencies

1.2.1 • Public • Published

Low Dependency Check Dependencies.

You probably shouldn't use this as it's only 5 lines of code. Here they are

function dependenciesNeedUpdating() {
  const childProcess = require('child_process');
  const result = JSON.parse(childProcess.execSync('npm install --dry-run --json').toString());
  return result.added.length > 0 || result.updated.length > 0 || result.removed > 0;
}

module.exports = dependenciesNeedUpdating;

Installation

npm install --save-dev ld-check-dependencies;

Usage

In JavaScript

const dependenciesNeedUpdating = require('ld-check-dependencies');
if (dependenciesNeedUpdating()) {
  throw new Error('please run `npm install`);
}

In npm

  ...
  "scripts": {
    "build": "ld-check-dependencies && rollup ..."
  },
  ...

License

MIT: ... though do 5 lines of code really need a license? ¯\(ツ)

Readme

Keywords

Package Sidebar

Install

npm i ld-check-dependencies

Weekly Downloads

7

Version

1.2.1

License

MIT

Unpacked Size

3.52 kB

Total Files

5

Last publish

Collaborators

  • greggman