0.2.3 • Published 4 years ago

lock-check v0.2.3

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

lock-check

npm version build status

A tool to peek at and compare yarn lockfiles.


Installation

This package is available via npm. To install globally, run the following command:

npm install -g lock-check

Note that node and npm must be installed prior to the command being run. The recommended minimum node version is v10.

Usage

There are a number of commands available for the lock-check tool:

  • peek: Peek at the requested vs resolved versions of packages within a single lockfile
  • compare: Compare the requested vs resolved versions of packages between two lockfiles

A list of currently available commands can also be fetched from the tool by running the help command:

lock-check help

Peek

The peek command takes a single relative path to a yarn lockfile, and performs a simple transform. The transform will output a table to the console window, outlining the requested vs resolved versions of yarn packages that have been included in the specified lockfile.

Here is the API for the peek command:

peek <lockfile>

Here is an example usage of the peek command:

lock-check peek ./yarn.lock

Here is an example of the output for the peek command:

┌─────────┬───────┬───────────────┬──────────┐
│ (index) │ name  │   requested   │ resolved │
├─────────┼───────┼───────────────┼──────────┤
│    0    │ 'foo' │ [ '^10.2.3' ] │ '10.2.4' │
│    1    │ 'bar' │ [ '^2.20.3' ] │ '2.20.4' │
│    2    │ 'baz' │ [ '^3.2.30' ] │ '3.2.40' │
└─────────┴───────┴───────────────┴──────────┘

Compare

The compare command takes a two relative paths to two separate yarn lockfiles, and performs a comparison. The comparison will output a table to the console window, outlining the requested vs resolved versions of yarn packages that have been included across the two specified lockfiles.

Here is the API for the compare command:

compare <first-lockfile> <second-lockfile>

Here is an example usage of the compare command:

lock-check compare ./project-1/yarn.lock ./project-2/yarn.lock

Here is an example of the output for the compare command:

┌─────────┬───────┬──────────────────────────┬─────────────────────────┬───────────────────────────┬──────────────────────────┐
│ (index) │ name  │ first lockfile requested │ first lockfile resolved │ second lockfile requested │ second lockfile resolved │
├─────────┼───────┼──────────────────────────┼─────────────────────────┼───────────────────────────┼──────────────────────────┤
│    0    │ 'bar' │      [ '^2.20.3' ]       │      [ '2.20.4' ]       │ [ '^2.20.3', '^2.20.4' ]  │       [ '2.20.5' ]       │
│    1    │ 'baz' │      [ '^3.2.30' ]       │      [ '3.2.40' ]       │ [ '^3.2.30', '~3.2.40' ]  │       [ '3.2.50' ]       │
│    2    │ 'foo' │      [ '^10.2.3' ]       │      [ '10.2.4' ]       │ [ '^10.2.3', '^10.2.4' ]  │       [ '10.2.5' ]       │
└─────────┴───────┴──────────────────────────┴─────────────────────────┴───────────────────────────┴──────────────────────────┘
0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago