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

depver

v1.0.0

Published

a utility for checking node_modules dependency versions

Downloads

2

Readme

depver

a utility for checking node_modules dependency versions

usage

> npx depver <selector?> <quantifier?> <predicate?> <options?>

e.g.

> npx depver through --all --gte 2.3.4 --verbose
through 2.2.7 false
through 2.2.7 false
none of 2 dependencies matched lt 2

selector

this can be omitted. if no selector is specified, we'll check over every dependency in the tree.

in the simple case, this is the name of the dependency you're checking for. we can list every instance of through in the tree by running

> npx depver through --verbose
through 2.2.7
through 2.2.7

for advanced use cases, we support full cssauron-json selectors for example, we can list all of the dependencies rooted in string-width:

> npx . ".string-width *" --verbose
code-point-at 1.1.0
number-is-nan 1.0.1
is-fullwidth-code-point 1.0.0
strip-ansi 3.0.1
code-point-at 1.1.0
is-fullwidth-code-point 1.0.0
strip-ansi 3.0.1
is-fullwidth-code-point 2.0.0
ansi-regex 3.0.0
strip-ansi 4.0.0

quantifier

if a quantifier is specified, depver will exit 0 if the test is satisfied, or 1 if the test fails.

  • --any (alias --some): true if at least one dependency matches the test
  • --all (alias --every): true if every dependency matches the test

for example, to test if there is a dependency on yargs:

> npx depver yargs --any && echo this package depends on yargs || echo yargs not found
this package depends on yargs

predicate

this tests for conditions matched against the dependency versions

supported tests (from the semver package:

  • gt
  • gte
  • eq
  • neq
  • lt
  • lte
  • satisfies (on a semver range)

e.g. to list all instances of through greater than or equal to 2.0.0:

> npx depver through --gt 2 --verbose
through 2.2.7 true
through 2.2.7 true

options

  • --verbose (alias -v)

if a predicate or quantifier is specified, this defaults to true, otherwise you must supply this flag if you want printed output. the exit code from depver can be useful for scripting.

note on output format

this may change without warning in the semver of this package. do not write scripts which depend on the stdout.

the exit codes are supported and will not change, ever, in depver. any changes will result i a package name change.

thanks for reading this far!

license ISC