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

@bhodgson/image-tagger

v0.2.2

Published

Tags images from a vocabulary you define, with a decision model that returns a probability for every tag and never invents its own.

Readme

@bhodgson/image-tagger

npm CI License: MIT

Tags images from a vocabulary you define. Each category becomes a typed question for a decision model, which returns a probability for every value you allow and nothing else: it can't invent a tag. Answers that name anything outside the vocabulary are rejected.

The default backend is Amos 1 Large, called through its hosted API, which needs no key.

Read the docs for guides and the API reference, or try the playground: define your own tags and tag your own images or the samples.

Use the package

Runs in Node.js 22.12 or later, and in modern browsers.

pnpm add @bhodgson/image-tagger
import { readFile } from "node:fs/promises";
import { AmosBackend, Tagger } from "@bhodgson/image-tagger";

const tagger = new Tagger({
  backend: new AmosBackend(),
  vocabulary: {
    people: {
      type: "single",
      question: "How many people are in the photo?",
      values: { none: null, few: "One to five people.", crowd: "A crowd." },
    },
    setting: {
      type: "multi",
      values: { beach: null, mountains: null, city: null },
    },
    night: { type: "flag", question: "Was the photo taken at night?" },
  },
});

const result = await tagger.tag({
  id: "getxo-1",
  image: { data: await readFile("getxo.jpg"), mimeType: "image/jpeg" },
  context: "Lead photo for a travel guide to Getxo, Spain.",
});

result.labels; // ["people:few", "setting:beach", "setting:city"]
result.tags.people; // { type: "single", value: "few", confidence: 0.81, probabilities: { ... } }

Create one Tagger and reuse it. Failures throw a TaggingError; see Errors.

Develop

Needs Node.js 24 (nvm use) and a global pnpm 12 or later (brew upgrade pnpm). The exact pnpm version is pinned in package.json and switched to automatically.

pnpm install
pnpm test:run                 # Unit tests
pnpm test:e2e                 # Tags a fixture image with the hosted Amos API
pnpm build && pnpm --filter image-tagger-example start [image]   # Run the example project
pnpm --filter image-tagger-docs dev                              # The docs, at http://localhost:4321/image-tagger/
pnpm --filter image-tagger-demo dev                              # The playground

Before opening a pull request:

pnpm format && pnpm lint && pnpm typecheck && pnpm knip
pnpm changeset         # If the published package changed

| Script | Does | | -------------------- | ----------------------------------------------- | | pnpm build | Compiles to dist/ | | pnpm lint | oxlint with type-aware rules (lint:fix fixes) | | pnpm format | Prettier (format:check only checks) | | pnpm knip | Finds unused files, exports and dependencies | | pnpm check:package | Checks the packed package's exports and types |

Releasing and CI: docs/src/content/docs/contributing/releasing.md.