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

@bleepit/ocr

v0.2.2

Published

Profanity detection for images: OCR adapter for bleepit, with match-to-bounding-box mapping. Zero runtime dependencies, bring your own OCR engine.

Readme

@bleepit/ocr

Profanity detection for images. OCR the page, scan the recognized text with @bleepit/core, and get back each match with the bounding boxes it came from.

Zero runtime dependencies — you bring the OCR engine.

pnpm add @bleepit/ocr @bleepit/core

Usage

import { createChecker } from "@bleepit/core";
import { createImageChecker } from "@bleepit/ocr";

const ic = createImageChecker({
  engine: myOcrEngine,
  checker: createChecker({ languages: ["en", "es"] }),
});

await ic.isProfane(image); // boolean
await ic.find(image); // ImageMatch[] — word, text, boxes, confidence
await ic.redact(image); // BBox[] — one merged box per match

Word fragments and the crossWord tradeoff

bleepit strips non-alphanumerics before matching — that is what catches a.r.s.e. The consequence for OCR is that any gap between two recognized words disappears, so "ar" and "se" in adjacent boxes would scan as one word. No separator character avoids this; only a letter would, and injecting letters corrupts offsets.

So each OCR word is scanned on its own by default. Neighbouring words cannot collide, at the cost of missing profanity that OCR split across two boxes. Flip it when a split word is the likelier failure:

createImageChecker({ engine, crossWord: true });

Expect more false positives in that mode — it is the right choice for noisy scans of stylized type, and the wrong one for dense screenshots of prose.

Bring your own engine

An engine is any object with a recognize method returning positioned words:

interface OcrEngine {
  recognize(image: ImageInput): Promise<{ words: OcrWord[] }>;
  terminate?(): Promise<void>;
}

interface OcrWord {
  text: string;
  bbox: { x0: number; y0: number; x1: number; y1: number };
  confidence: number; // 0–100
}

That is the whole contract. Adapting a cloud OCR API means mapping its response into that shape.

This package never decodes, resizes, or preprocesses images — it passes the input straight to the engine. It also does not draw redactions: redact() returns geometry, because rasterizing needs a canvas or an image library, and that dependency is yours to choose.

If OCR already runs elsewhere in your pipeline, skip the engine round-trip:

ic.findInWords(words); // synchronous, same ImageMatch[]

Accuracy

OCR output is noisier than typed text, and this raises false positives. bleepit normalizes leet-speak, mapping 1→i and 0→o. OCR makes the same confusions, so the normalizer silently repairs a lot of recognition error — pr1ck still matches. The cost is that OCR garbage also normalizes toward dictionary words, and flags that would never fire on typed input.

minConfidence (default 60) is the main lever. Raise it for photographs and scans; lower it for clean screenshots where a miss costs more than a false positive. Tune it against images that look like yours — the right value depends on your engine and your inputs, not on a general default.

Two limits worth stating plainly:

  • Text only. This finds profane words in an image. It does not detect offensive imagery, gestures, or symbols — that is an image classifier, and a different problem with different failure modes.
  • A miss is not a guarantee. Stylized type, low contrast, curved text, and handwriting all defeat OCR. Treat a clean result as "nothing recognized," not "nothing there."

License

Apache-2.0