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

code-provenance

v0.1.12

Published

Resolve Docker images to their source code commits on GitHub

Readme

code-provenance

Resolve Docker images in a docker-compose file to their exact source code commits on GitHub.

Installation

npm install code-provenance

Requires Node.js 20+.

CLI Usage

npx code-provenance [compose-file] [--image IMAGE] [--json] [--verbose]
  • compose-file -- path to a docker-compose file (default: docker-compose.yml)
  • --image IMAGE -- resolve a single image reference instead of a compose file
  • --json -- output results as JSON
  • --verbose, -v -- show resolution steps for each image

Examples

Resolve all images in a docker-compose file:

npx code-provenance docker-compose.yml
web: traefik:v3.6.0
  repo:       github.com/traefik/traefik
  commit:     06db5168c0d9
  status:     resolved
  confidence: exact
  url:        https://github.com/traefik/traefik/commit/06db5168c0d9...

Resolve a single image:

npx code-provenance --image ollama/ollama:0.12.3
image: ollama/ollama:0.12.3
  repo:       github.com/ollama/ollama
  commit:     b04e46da3ebc
  status:     resolved
  confidence: exact
  url:        https://github.com/ollama/ollama/commit/b04e46da3ebc...

Library Usage

import { readFileSync } from "node:fs";
import { parseCompose, parseImageRef, resolveImage } from "code-provenance";

const yaml = readFileSync("docker-compose.yml", "utf-8");
for (const [service, image] of parseCompose(yaml)) {
  const ref = parseImageRef(image);
  const result = await resolveImage(service, ref);
  console.log(`${result.service}: ${result.commit} (${result.confidence})`);
}

API Reference

Exports

  • parseCompose(yaml: string): [string, string][] -- parse a docker-compose YAML string and return [serviceName, imageString] pairs
  • parseImageRef(image: string): ImageRef -- parse a Docker image string into its components
  • resolveImage(service: string, ref: ImageRef): Promise<ImageResult> -- resolve an image reference to its source code commit
  • formatTable(results: ImageResult[]): string -- format results as a table
  • formatJson(results: ImageResult[]): string -- format results as JSON

ImageRef

| Field | Type | Description | |-------|------|-------------| | registry | string | e.g. "ghcr.io", "docker.io" | | namespace | string | e.g. "myorg", "library" | | name | string | e.g. "traefik", "postgres" | | tag | string | e.g. "v3.6.0", "latest" | | raw | string | original image string from docker-compose |

ImageResult

| Field | Type | Description | |-------|------|-------------| | service | string | service name from docker-compose | | image | string | original image string | | registry | string | image registry | | repo | string \| null | GitHub repository URL | | tag | string | image tag | | commit | string \| null | resolved commit SHA | | commit_url | string \| null | URL to the commit on GitHub | | status | string | "resolved", "repo_not_found", "repo_found_tag_not_matched", or "no_tag" | | resolution_method | string \| null | how the commit was resolved (e.g. "oci_labels", "tag_match") | | confidence | string \| null | "exact" or "approximate" | | steps | string[] | resolution steps taken (useful with --verbose) |

Authentication

Set GITHUB_TOKEN for full functionality (digest resolution, :latest on GHCR, higher rate limits):

export GITHUB_TOKEN=ghp_your_token_here

Create a classic token at https://github.com/settings/tokens with read:packages scope.

License

MIT