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 🙏

© 2026 – Pkg Stats / Ryan Hefner

hopic

v0.1.2

Published

snapshot testing for child process output

Readme

Hopic

snapshot testing for CLI app output

installation

download from the github releases tab or get from npm with npm i -g hopic

usage

write the commands you'd like to execute in a yml file with comments indicating the commands, like so:

#> ls

#> echo hi

#> pwd

Pass that yml file to hopic:

$ hopic myfile.yml

It'll execute all the commands and put their output after them:

#> ls
status: 0
stdout: |
  LICENSE
  README.md
  build.js
  dist
  kame.config.ts
  myfile.yml
  node_modules
  npm
  package-lock.json
  package.json
  sample
  src
  tsconfig.json
  types.d.ts
stderr: ""

#> echo hi
status: 0
stdout: |
  hi
stderr: ""

#> pwd
status: 0
stdout: |
  /Users/suchipi/Code/hopic
stderr: ""

Now if you run hopic again and the output doesn't match, it'll error. Pass -u or --update to ignore the error and replace the file contents with the new contents instead.

filtering out machine-specific content from snapshots

You may wish to omit machine-specific content from snapshots. You can do this by specifying a --config-file that is a js/ts file that exports a transformResult function like so:

const rootDir = GitRepo.findRoot(pwd()).toString();

function cleanStr(str) {
  return str.replaceAll(rootDir, "<rootDir>");
}

export const transformResult = (result) => {
  return {
    ...result,
    stdout: cleanStr(result.stdout),
    stderr: cleanStr(result.stderr),
  };
};

Now when you run hopic, the result from that pwd command will get transformed by your function:

#> pwd
status: 0
stdout: |
  <rootDir>
stderr: ""

other stuff

  • you can specify a transformCmd function in your --config-file to change how the command-line string gets turned into argv to run. The default implementation passes the entire line to bash -c.
  • you can use --dry-run to not update any files
  • normally, if a file is blank, you don't have to specify -u or --update to update its snapshots. But in CI, you do, because a blank file making it to CI is probably a mistake. This happens based on the CI environment variable being "true" or "1", or passing the --ci flag

license

MIT

name?

snapshot = pic, you hope the snapshots match, hope pic, hopic