npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

lock-check

v0.2.3

Published

A tool to peek at and compare yarn lockfiles

Downloads

10

Readme

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' ]       │
└─────────┴───────┴──────────────────────────┴─────────────────────────┴───────────────────────────┴──────────────────────────┘