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

boro-shield

v1.0.0

Published

Zero-dependency invisible DCT image watermarking and provenance verification. Pure Node.js — no native addons, no external packages.

Readme

🛡️ Boro-Shield

Zero-dependency invisible image watermarking and provenance verification for Node.js.

No sharp. No canvas. No native addons. Pure JavaScript — runs anywhere Node.js runs.

Embeds owner identity into DCT frequency coefficients. The watermark survives cropping, re-compression, and screenshots — and cannot be forged without your secret key.


Installation

npm install boro-shield

No peer dependencies. Nothing else needed.


Supported Formats

| Format | Support | |--------|---------| | BMP (24-bit) | ✅ Native — zero deps | | PPM (P6) | ✅ Native | | JPEG / PNG / WebP | ⚙️ Auto via convertAndProtect() — needs ImageMagick or ffmpeg |

To install ImageMagick: sudo apt install imagemagick / brew install imagemagick


Quick Start

import { BoroShield } from 'boro-shield';
import { readFileSync } from 'fs';

const shield = new BoroShield({ secretKey: process.env.SHIELD_SECRET });

// BMP directly (zero deps)
const { protectedBuffer, fingerprint } = await shield.protect(
  readFileSync('photo.bmp'),
  { ownerId: 'user_123', location: '9.03,38.74' }
);

// JPEG/PNG (auto-converts using ImageMagick/ffmpeg)
const { protectedBuffer } = await shield.convertAndProtect(
  readFileSync('photo.jpg'),
  { ownerId: 'user_123' }
);

// Verify any upload
const result = await shield.verify(readFileSync('uploaded.bmp'));
if (result.isAuthentic) {
  console.log('Owner:', result.payload.ownerId);
}

// Duplicate detection
const { isDuplicate } = await shield.compare(bufA, bufB);

API

| Method | Description | |--------|-------------| | protect(bmpBuf, payload) | Watermark BMP/PPM natively | | convertAndProtect(anyBuf, payload) | Auto-convert + watermark | | verify(buf) | Extract and verify watermark | | audit(buf) | Detect Photoshop edits, AI generation, social media downloads | | fingerprint(buf) | Get signed perceptual hash for DB storage | | compare(bufA, bufB) | Duplicate detection via pHash Hamming distance |


Config

new BoroShield({
  secretKey:        process.env.SHIELD_SECRET, // required, min 16 chars
  watermarkDensity: 0.7,   // 0–1, how many blocks to use
  sensitivity:      10,    // Hamming distance threshold for duplicates
  strength:         5,     // DCT modification strength
})

Generate a secret: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"


How It Works

  1. Your payload (ownerId, location, etc.) is signed with HMAC-SHA256
  2. The signed token is converted to a bitstream
  3. A secret-seeded PRNG picks scattered 8×8 pixel blocks
  4. Each block: forward DCT → encode bits into mid-frequency coefficients → inverse DCT
  5. Repeated N times across the image (redundancy — survives cropping)
  6. On verify: same PRNG → same blocks → decode bits → verify HMAC signature

License

MIT — by Yohannes