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

pkgparse

v2.1.1

Published

A module for searching details about other modules

Downloads

19

Readme

pkgparse

A tiny NPM searching CLI

npm version License Scrutinizer Code Quality

Table of Contents

  1. What Does pkgparse Do
  2. How Do You Install It
  3. How Does It Work
    1. Searching For A Module
    2. Consuming A Package.json File
    3. Consuming The package.json of a Remote Module
    4. Jump To The NPM Page Of A Module
    5. Jump To The Github Page Of A Module
  4. I Found A Bug
  5. I Want To Request A Feature

What Does pkgparse Do

You can...

  • search for an NPM module by name and receive its description
  • feed it a package.json and receive descriptions of each valid dependency
  • search for an NPM module and get back a list of its dependencies
  • quickly navigate to a module's npm page or github repo (if it exists) in your default browser

How Do You Install It

Like most Node packages, it's available via NPM for whatever flavour of device you're on.

Simply run a global install using your terminal and you're good to go!

npm install pkgparse -g

If you're a cool kid using Yarn then simply just use yarn as you would

yarn global add pkgparse

How Does It Work

You've got a few options...

Searching For A Module

You can use the search function to look up an NPM module and retrieve its description field, if it exists.

I find it handy for a super brief overview if I see a module name without wanting to trudge through too much documentation.

That said, it's only as good as the author makes their description!

You can use it by passing it the name of a module. Let's say you keep hearing about rethinkdbdash but you still don't know what it does

// pkgparse search rethinkdbdash
↳ rethinkdbdash => A Node.js driver for RethinkDB with promises and a connection pool

Consuming A Package.json File

This is probably my favourite feature and the main reason I started building this tool in the first place.

It's basically the search feature, but applied to each dependency in a package.json file.

I found it useful while doing Node test exercises and wondering what half the dependencies even do.

It can also be used on cloned repos to get a quick overview of what its dependencies are (and actually do) without having to search for each one.

Here's what it looks like applied to pkgparse itself:

// pkgparse feast (while in same folder as the repo)
↳ opn => A better node-open. Opens stuff like websites, files, executables. Cross-platform.
↳ chalk => Terminal string styling done right. Much color.
↳ caporal => A full-featured framework for building command line applications (cli) with node.js
↳ axios => Promise based HTTP client for the browser and node.js

Now you know exactly what each of the four dependencies that make up pkgparse do in less than 5 seconds (excluding reading time and/or internet outages)

Consuming The Package.json Of A Remote Module

The feast function would be a pain in the butt if you had to clone your favourite modules just to see what they're made of so it also comes with an optional argument for parsing modules on NPM.

Let's see what create-react-app is made of...

// pkgparse feast --module create-react-app
create-react-app is made of...
↳ validate-npm-package-name => Give me a string and I'll tell you if it's a valid npm package name
↳ chalk => Terminal string styling done right. Much color.
↳ cross-spawn => Cross platform child_process#spawn and child_process#spawnSync
↳ commander => the complete solution for node.js command-line programs
↳ semver => The semantic version parser used by npm.
↳ fs-extra => fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.

Neat, I find this feature useful for learning about new modules myself.

Heck, I could have used that validate-npm-package-name module in pkgparse itself but ah well, it's fast enough as it is.

Jump To The NPM Page Of A Module

This feature and the next are mainly just handy shortcuts for myself but you might get some use out of them too!

// pkgparse open express
[opens https://www.npmjs.com/package/express in your default browser]

Jump To The Github Page Of A Module

Pretty much the same deal as the open command but goes to GitHub instead...

// pkgparse gh express
[opens https://github.com/expressjs/express in your default browser]

I Found A Bug

Feel free to report it under the Issues tab, using the bug label, and I'll see what I can figure out.

I Want To Request A Feature

Well, it's not really that kind of project but you're welcome to suggest stuff under the Issues by using the enhancement label.

You're always welcome to write additional features yourself via a pull request. All you really need to do is plug your function into the parseMenu.js file and a brief menu entry under pkgparse.js.

You can even just modify your own fork and install it using npm install <your github name>/pkgparse -g. That said, I'll consider any upstream pushes too.