pompelmi 0.34.8 → 0.34.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +56 -21
  3. package/package.json +5 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## Unreleased (main)
9
+
10
+ ### Highlights
11
+
12
+ - Fixed `@pompelmi/fastify-plugin` multipart dependency wiring and removed an unnecessary promise hop.
13
+ - Refined the root README layout for faster first-run onboarding and clearer repo entry points.
14
+ - Refreshed README badges and demo media so the public repo surface is easier to scan quickly.
15
+ - Added verified mention badges to strengthen the top-level trust signals around adoption.
16
+ - Tightened onboarding copy across the repo surfaces to make the docs-and-examples path easier to follow.
17
+
18
+ ### Notes
19
+
20
+ This section summarizes changes since the last tag: `v0.34.8`.
21
+ Post-tag activity is currently limited, so the highlights above also surface the most recent user-visible commits from the current `v0.34.x` line for context.
22
+ For full details, see GitHub Releases / tag diffs.
23
+
8
24
  ## [0.27.1] - 2026-01-26
9
25
 
10
26
  ### Security
package/README.md CHANGED
@@ -1,10 +1,11 @@
1
1
  <div align="center">
2
2
  <img src="assets/logo.svg" alt="Pompelmi logo" width="160" />
3
- <h1>Pompelmi</h1>
4
- <p>Local-first file upload scanning for Node.js.</p>
3
+ <h1>Pompelmi — in-process file upload security for Node.js</h1>
4
+ <p>Scan and block risky uploads before storage — no cloud API, no daemon, no required data egress.</p>
5
5
  <p>
6
6
  <a href="https://www.npmjs.com/package/pompelmi"><img alt="npm version" src="https://img.shields.io/npm/v/pompelmi"></a>
7
7
  <a href="https://github.com/pompelmi/pompelmi/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/pompelmi/pompelmi/ci.yml?label=ci"></a>
8
+ <a href="https://codecov.io/gh/pompelmi/pompelmi"><img alt="Codecov" src="https://codecov.io/gh/pompelmi/pompelmi/branch/main/graph/badge.svg?flag=core"></a>
8
9
  <a href="https://github.com/pompelmi/pompelmi/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/pompelmi/pompelmi"></a>
9
10
  <a href="https://www.npmjs.com/package/pompelmi"><img alt="npm downloads" src="https://img.shields.io/npm/dm/pompelmi"></a>
10
11
  </p>
@@ -22,9 +23,9 @@
22
23
  </p>
23
24
  </div>
24
25
 
25
- Pompelmi inspects untrusted files before storage and helps you decide whether to allow, reject, or quarantine them before they reach downstream systems.
26
-
27
- It is built for upload endpoints that cannot rely on filenames, extensions, or client-provided MIME types alone.
26
+ > **Why:** Upload endpoints are part of your attack surface. Pompelmi inspects untrusted files _before_ they hit storage or downstream processors.
27
+ > **How:** in-process scanning + policy packs (MIME sniffing, archive abuse checks, risky structures) with optional YARA.
28
+ > **Works with:** Express, Next.js, NestJS, Fastify, Koa (plus adapters in `packages/`).
28
29
 
29
30
  ## Demo
30
31
 
@@ -38,28 +39,70 @@ npm install pompelmi
38
39
 
39
40
  Requires Node.js 18+.
40
41
 
42
+ ## Try in 5 minutes
43
+
44
+ 1. Install:
45
+
46
+ ```bash
47
+ npm install pompelmi
48
+ ```
49
+
50
+ 2. Create `scan-test.mjs`:
51
+
52
+ ```js
53
+ import { scanBytes } from "pompelmi";
54
+ import { readFileSync } from "node:fs";
55
+
56
+ const buffer = readFileSync("./package.json");
57
+
58
+ const report = await scanBytes(buffer, {
59
+ filename: "package.json",
60
+ mimeType: "application/json",
61
+ });
62
+
63
+ console.log("Verdict:", report.verdict);
64
+ console.log("Reasons:", report.reasons);
65
+ console.log("Duration:", report.durationMs, "ms");
66
+ ```
67
+
68
+ 3. Run it:
69
+
70
+ ```bash
71
+ node scan-test.mjs
72
+ ```
73
+
74
+ Next: see the demo under [examples/demo](./examples/demo) (upload route) or the docs [Getting started](https://pompelmi.github.io/pompelmi/getting-started/) guide.
75
+
41
76
  ## Quick Start
42
77
 
43
78
  ```ts
44
- import { scanBytes } from 'pompelmi';
79
+ import { scanBytes, STRICT_PUBLIC_UPLOAD } from "pompelmi";
45
80
 
46
81
  const report = await scanBytes(file.buffer, {
47
- ctx: {
48
- filename: file.originalname,
49
- mimeType: file.mimetype,
50
- size: file.size,
51
- },
82
+ filename: file.originalname,
83
+ mimeType: file.mimetype,
84
+ policy: STRICT_PUBLIC_UPLOAD,
85
+ failClosed: true,
52
86
  });
53
87
 
54
- if (!report.ok) {
88
+ if (report.verdict !== "clean") {
55
89
  return res.status(422).json({
56
- error: 'Upload blocked',
90
+ error: "Upload blocked",
57
91
  verdict: report.verdict,
58
92
  reasons: report.reasons,
59
93
  });
60
94
  }
61
95
  ```
62
96
 
97
+ ## Next steps
98
+
99
+ - [Documentation](https://pompelmi.github.io/pompelmi/)
100
+ - [Examples index](./examples/README.md)
101
+ - [Demo example](./examples/demo)
102
+ - [Contributing](./CONTRIBUTING.md)
103
+ - [Security](./SECURITY.md)
104
+ - [Roadmap](./ROADMAP.md)
105
+
63
106
  ## What Problem It Solves
64
107
 
65
108
  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.
@@ -106,14 +149,6 @@ pnpm test
106
149
  pnpm build
107
150
  ```
108
151
 
109
- ## Links
110
-
111
- - [Documentation](https://pompelmi.github.io/pompelmi/)
112
- - [Examples](./examples)
113
- - [Contributing](./CONTRIBUTING.md)
114
- - [Security](./SECURITY.md)
115
- - [Roadmap](./ROADMAP.md)
116
-
117
152
  <!-- MENTIONS:START -->
118
153
 
119
154
  ## 🌟 Featured In
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pompelmi",
3
- "version": "0.34.8",
3
+ "version": "0.34.10",
4
4
  "description": "Secure file uploads for Node.js. Scan untrusted files before storage with in-process, local-first checks for MIME spoofing, archive bombs, risky document structures, and optional YARA.",
5
5
  "main": "./dist/pompelmi.cjs",
6
6
  "module": "./dist/pompelmi.esm.js",
@@ -89,6 +89,10 @@
89
89
  "docs:build": "hugo -s docs -D -d docs",
90
90
  "predocs:deploy": "npm run docs:build",
91
91
  "docs:deploy": "gh-pages -d docs -b gh-pages",
92
+ "format": "biome format --write .",
93
+ "format:check": "biome format .",
94
+ "lint": "biome ci .",
95
+ "lint:fix": "biome check --write .",
92
96
  "yara:check": "node scripts/yara-quick-check-cli.mjs",
93
97
  "build:core": "pnpm -r --filter '!./examples/*' --if-present build",
94
98
  "preview": "npm pack --dry-run",