Skip to content

pompelmi/pompelmi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

468 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Pompelmi logo

Pompelmi β€” in-process file upload security for Node.js

Scan and block risky uploads before storage β€” no cloud API, no daemon, no required data egress.

npm version CI GitHub stars npm downloads

Mentioned in Awesome JavaScript Mentioned in Awesome TypeScript Featured in Node Weekly #594 Featured in Bytes #429

Featured in Detection Engineering Weekly #124 Featured on Stack Overflow by Ryan Donovan Featured in The Overflow #319 Featured in Help Net Security

Why: Upload endpoints are part of your attack surface. Pompelmi inspects untrusted files before they hit storage or downstream processors. How: in-process scanning + policy packs (MIME sniffing, archive abuse checks, risky structures) with optional YARA. Works with: Express, Next.js, NestJS, Fastify, Koa (plus adapters in packages/).

Demo

Pompelmi demo

Install

npm install pompelmi

Requires Node.js 18+.

Try in 5 minutes

  1. Install:
npm install pompelmi
  1. Create scan-test.mjs:
import { scanBytes } from "pompelmi";
import { readFileSync } from "node:fs";

const buffer = readFileSync("./package.json");

const report = await scanBytes(buffer, {
  filename: "package.json",
  mimeType: "application/json",
});

console.log("Verdict:", report.verdict);
console.log("Reasons:", report.reasons);
console.log("Duration:", report.durationMs, "ms");
  1. Run it:
node scan-test.mjs

Next: see the demo under examples/demo (upload route) or the docs Getting started guide.

Quick Start

import { scanBytes, STRICT_PUBLIC_UPLOAD } from "pompelmi";

const report = await scanBytes(file.buffer, {
  filename: file.originalname,
  mimeType: file.mimetype,
  policy: STRICT_PUBLIC_UPLOAD,
  failClosed: true,
});

if (report.verdict !== "clean") {
  return res.status(422).json({
    error: "Upload blocked",
    verdict: report.verdict,
    reasons: report.reasons,
  });
}

Next steps

What Problem It Solves

Upload endpoints are part of your attack surface. A renamed executable, a risky PDF, or a hostile archive can look harmless until it is stored, unpacked, served, or parsed by another system.

Pompelmi adds checks at the upload boundary for:

  • MIME spoofing and magic-byte mismatches
  • Archive abuse such as ZIP bombs, traversal, and deep nesting
  • Polyglot files and risky document structures
  • Optional YARA-based signature matching

The goal is simple: inspect first, store later.

Why This Shape

  • Plain Markdown, readable in GitHub and in a terminal
  • Fast path first: install, example, then deeper links
  • Minimal top-level detail, with docs and examples for everything else

Ecosystem

  • pompelmi
  • @pompelmi/express-middleware
  • @pompelmi/koa-middleware
  • @pompelmi/next-upload
  • @pompelmi/nestjs-integration
  • @pompelmi/fastify-plugin
  • @pompelmi/ui-react
  • @pompelmi/cli

Repository Layout

  • src/ core library
  • packages/ framework adapters and supporting packages
  • examples/ runnable examples
  • tests/ test coverage
  • website/ documentation site

Development

pnpm install
pnpm test
pnpm build

🌟 Featured In

Last updated: March 20, 2026

πŸ“‹ Awesome Lists & Curated Collections

πŸ“° Newsletters & Roundups

πŸ”— Other Mentions

Found 9 mentions. To update, run npm run mentions:update.

License

MIT