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

@peachlife/artisan

v0.1.5

Published

> **End-to-end artifact testing for CLIs.** > Stop merging green unit tests for broken binaries.

Downloads

1,107

Readme

Artisan

End-to-end artifact testing for CLIs. Stop merging green unit tests for broken binaries.

Unit tests verify your logic. Artisan proves your binary actually executes.

Artisan mounts your compiled CLI into ephemeral Linux containers across a distro matrix (Debian, Alpine, Arch) and lets you assert stdout, stderr, exit codes, and real filesystem mutations using a familiar Vitest API.

Backed by Testcontainers, Execa, and Vitest.

Why Artisan?

  • Catch runtime blindspots: Detect glibc vs musl mismatches, missing system dependencies, and hardcoded host paths.
  • Agent-proof your workflow: LLMs are great at writing passing unit tests for code that fails at runtime. Artisan enforces that "done" means the artifact works.
  • Zero-config discovery: Automatically finds executables in package.json#bin, ./dist, or ./bin.

Quickstart

Build your project, then run Artisan. It auto-discovers a single executable in dist/ or bin/ — no config needed.

npx @peachlife/artisan test

If you don't have tests yet, Artisan bootstraps your environment, installs dependencies, and generates a starter test on the first run.

If you have multiple binaries or a non-standard output path, point to a single artifact:

npx @peachlife/artisan test --artifact ./build/my-cli

The API

Test what users actually observe. Assert on exit codes, output, and container filesystem side-effects.

// tests/artisan/cli.artisan.test.mjs
import { expect, test } from "@peachlife/artisan";

test("writes expected output to the filesystem", async ({ run, setup }) => {
  // Setup container state
  await setup(["rm -f /tmp/output.txt"]);

  // Execute the compiled artifact
  const { stdout, exitCode } = await run([
    "write-file",
    "/tmp/output.txt",
    "unicorn sequence initiated",
  ]);

  // Assert binary execution
  expect(exitCode).toBe(0);
  expect(stdout).toContain("wrote /tmp/output.txt");

  // Assert filesystem side-effects
  await setup([
    "test -f /tmp/output.txt",
    "grep -q '^unicorn sequence initiated$' /tmp/output.txt",
  ]);
});

Matrix Testing via Config

Need to test across different environments? Drop an artisan.config.json in your root:

{
  "distros": ["debian:stable-slim", "alpine:latest", "archlinux/archlinux:latest"],
  "testMatch": "**/*.artisan.test.mjs",
  "parallel": true
}

Set "artifact" only if auto-discovery can't find your binary (multiple executables or a non-standard path).

Config Fixtures

Config parsing is where most CLIs silently fail (~ paths, wrong XDG locations, missing files). Artisan can capture your host configuration, scrub secrets, and mount it cleanly into the sandbox's $XDG_CONFIG_HOME.

# Capture, sanitize, and inject real config into your tests
npx @peachlife/artisan add config ~/.config/mycli --name mycli-config

CLI Reference

| Command | Description | | --- | --- | | npx @peachlife/artisan test | Run all tests across the configured matrix | | npx @peachlife/artisan test <file> | Run a specific test file | | npx @peachlife/artisan test -t "auth" | Filter test execution by regex | | npx @peachlife/artisan test --serial | Run distros sequentially | | npx @peachlife/artisan init | Scaffold setup without running tests |

Exit Codes

| Code | Meaning | | --- | --- | | 0 | All tests passed | | 1 | One or more tests failed / timed out | | 2 | Usage or configuration error | | 125 | Docker/container startup error | | 130 | Interrupted by the user |

CI Integration

Artisan runs perfectly in CI as long as the runner has Docker access.

CI tip: if your pipeline manages its own npm ci step, pass --no-install to artisan init or artisan test --bootstrap to skip the redundant install.

name: Artifact Tests
on: [push, pull_request]

jobs:
  artisan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
      - run: npm ci
      - run: npm run build # Ensure your artifact is compiled!
      - run: npx @peachlife/artisan test --artifact <my-cli> --no-color

License

MIT