Coder Social home page Coder Social logo

lgtm-migrator / npm-check-engines Goto Github PK

View Code? Open in Web Editor NEW

This project forked from smarlhens/npm-check-engines

0.0 0.0 0.0 946 KB

Compute npm package engines constraint to the most restrictive used by your dependencies.

Home Page: https://www.npmjs.com/package/@smarlhens/npm-check-engines

License: MIT License

Shell 0.21% JavaScript 1.52% TypeScript 98.27%

npm-check-engines's Introduction

NPM check engines

GitHub CI Total alerts Language grade: JavaScript node-current (scoped) GitHub license code style: prettier Conventional Commits

npm-check-engines upgrades your package.json node engines constraint to the most restrictive used by your dependencies.


Table of Contents


Prerequisites

  • Node.JS version ^16.13.0 || ^18.0.0

Installation

Install globally:

npm install -g @smarlhens/npm-check-engines

Or run with npx:

npx @smarlhens/npm-check-engines

Usage

Show the most restrictive constraint (opinionated) of the node engine for the project in the current directory based on the npm package-lock.json file:

$ nce
✔ Computed engines range constraints:

 node  *  →  ^14.17.0 || ^16.10.0 || >=17.0.0

Run nce -u to upgrade package.json.

Upgrade a project's package.json file:

$ nce -u
✔ Computed engines range constraints:

 node  *  →  ^14.17.0 || ^16.10.0 || >=17.0.0

Options

Usage: nce [options]

Options:
  -p, --path     Path to the NPM package folder. Default will use current folder.                 [string]
  -q, --quiet    Enable quiet mode.                                             [boolean] [default: false]
  -d, --debug    Enable debug mode. Can be used with environment variable DEBUG=nce.
                                                                                [boolean] [default: false]
  -v, --verbose  A little more detailed than the default output.                [boolean] [default: false]
  -e, --engines  Select engines to check. Default will check all engines defined.                  [array]
  -u, --update   Update engines in package.json file.                           [boolean] [default: false]
      --help     Show help                                                                       [boolean]
      --version  Show version number                                                             [boolean]

Examples:
  nce                 Check package-lock.json file in current working directory.
  nce -p examples -u  Check package-lock.json file and update engines in package.json in relative examples
                      directory.

© 2022 Samuel MARLHENS

Debug

$ DEBUG=* nce -d
output with debug
[STARTED] Checking npm package engines range constraints in package-lock.json file...
[TITLE] Checking npm package engines range constraints in examples\package-lock.json file...
[STARTED] Load package.json file...
  nce Relative path to package.json: examples\package.json +0ms
  nce Validate JSON schema of examples\package.json +3ms
[SUCCESS] Load package.json file...
[STARTED] Load package-lock.json file...
  nce Relative path to package-lock.json: examples\package-lock.json +7ms
  nce Validate JSON schema of examples\package-lock.json +1ms
[SUCCESS] Load package-lock.json file...
[STARTED] Compute engines range constraints...
  nce:node Package  has no constraints for current engine +0ms
  nce:node Final computed engine range constraint: * +0ms
  nce:node Package  has no constraints for current engine +0ms
  nce:node Compare: * and >=6.9.0 +1ms
  nce:node Range >=6.9.0 is a subset of * +1ms
  nce:node New most restrictive range: >=6.9.0 +0ms
  nce:node Compare: >=6.9.0 and >=12.22.0 +0ms
  nce:node Range >=12.22.0 is a subset of >=6.9.0 +1ms
  nce:node New most restrictive range: >=12.22.0 +0ms
  nce:node Ignored range: * +0ms
  nce:node Compare: >=12.22.0 and >=7.0.0 +0ms
  nce:node Range >=12.22.0 is a subset of >=7.0.0 +0ms
  nce:node Package node_modules/noengines has no constraints for current engine +1ms
  nce:node Compare: >=12.22.0 and >=12.13.0 <13.0.0-0||>=14.15.0 <15.0.0-0||>=16.10.0 <17.0.0-0||>=17.0.0 +1ms
  nce:node Applying minimal version 12.22.0 to both ranges. +0ms
  nce:node Compare: >=12.22.0 and >=12.22.0 <13.0.0-0||>=14.15.0 <15.0.0-0||>=16.10.0 <17.0.0-0||>=17.0.0 +1ms
  nce:node Range >=12.22.0 <13.0.0-0||>=14.15.0 <15.0.0-0||>=16.10.0 <17.0.0-0||>=17.0.0 is a subset of >=12.22.0 +1ms
  nce:node New most restrictive range: >=12.22.0 <13.0.0-0||>=14.15.0 <15.0.0-0||>=16.10.0 <17.0.0-0||>=17.0.0 +0ms
  nce:node Compare: >=12.22.0 <13.0.0-0||>=14.15.0 <15.0.0-0||>=16.10.0 <17.0.0-0||>=17.0.0 and >=16.0.0||>=14.17.0 <15.0.0-0 +0ms
  nce:node Applying minimal version 14.17.0 to both ranges. +1ms
  nce:node Compare: >=14.17.0 <15.0.0-0||>=16.10.0 <17.0.0-0||>=17.0.0 and >=14.17.0 <15.0.0-0||>=16.0.0 +0ms
  nce:node Range >=14.17.0 <15.0.0-0||>=16.10.0 <17.0.0-0||>=17.0.0 is a subset of >=14.17.0 <15.0.0-0||>=16.0.0 +0ms
  nce:node New most restrictive range: >=14.17.0 <15.0.0-0||>=16.10.0 <17.0.0-0||>=17.0.0 +0ms
  nce:node Final computed engine range constraint: >=14.17.0 <15.0.0-0||>=16.10.0 <17.0.0-0||>=17.0.0 +0ms
  nce:npm Package  has no constraints for current engine +0ms
  nce:npm Final computed engine range constraint: * +0ms
  nce:npm Package  has no constraints for current engine +0ms
  nce:npm Package node_modules/foo has no constraints for current engine +0ms
  nce:npm Package node_modules/bar has no constraints for current engine +0ms
  nce:npm Package node_modules/all has no constraints for current engine +0ms
  nce:npm Package node_modules/arr has no constraints for current engine +0ms
  nce:npm Package node_modules/noengines has no constraints for current engine +0ms
  nce:npm Package node_modules/complex1 has no constraints for current engine +1ms
  nce:npm Package node_modules/complex2 has no constraints for current engine +0ms
  nce:npm Final computed engine range constraint: * +0ms
  nce:yarn Package  has no constraints for current engine +0ms
  nce:yarn Final computed engine range constraint: * +0ms
  nce:yarn Package  has no constraints for current engine +0ms
  nce:yarn Package node_modules/foo has no constraints for current engine +0ms
  nce:yarn Package node_modules/bar has no constraints for current engine +0ms
  nce:yarn Package node_modules/all has no constraints for current engine +0ms
  nce:yarn Package node_modules/arr has no constraints for current engine +1ms
  nce:yarn Package node_modules/noengines has no constraints for current engine +0ms
  nce:yarn Package node_modules/complex1 has no constraints for current engine +0ms
  nce:yarn Package node_modules/complex2 has no constraints for current engine +0ms
  nce:yarn Final computed engine range constraint: * +0ms
[SUCCESS] Compute engines range constraints...
[STARTED] Output computed engines range constraints...
  nce:node Simplified computed engine range constraint: ^14.17.0 || ^16.10.0 || >=17.0.0 +0ms
[TITLE] Computed engines range constraints:
[TITLE]
[TITLE]  node  *  →  ^14.17.0 || ^16.10.0 || >=17.0.0
[TITLE]
[TITLE] Run nce -p examples -d -u to upgrade package.json.
[SUCCESS] Output computed engines range constraints...
[STARTED] Update package.json file...
[SKIPPED] Update is disabled by default.
[SUCCESS] Computed engines range constraints:
[SUCCESS]
[SUCCESS]  node  *  →  ^14.17.0 || ^16.10.0 || >=17.0.0
[SUCCESS]
[SUCCESS] Run nce -p examples -d -u to upgrade package.json.

Thanks

This project is heavily inspired by the following awesome project: npm-check-updates.


npm-check-engines's People

Contributors

smarlhens avatar renovate-bot avatar renovate[bot] avatar mend-bolt-for-github[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.