pompelmi 0.34.8 → 0.34.9

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 +55 -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,7 +1,7 @@
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>
@@ -22,9 +22,9 @@
22
22
  </p>
23
23
  </div>
24
24
 
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.
25
+ > **Why:** Upload endpoints are part of your attack surface. Pompelmi inspects untrusted files _before_ they hit storage or downstream processors.
26
+ > **How:** in-process scanning + policy packs (MIME sniffing, archive abuse checks, risky structures) with optional YARA.
27
+ > **Works with:** Express, Next.js, NestJS, Fastify, Koa (plus adapters in `packages/`).
28
28
 
29
29
  ## Demo
30
30
 
@@ -38,28 +38,70 @@ npm install pompelmi
38
38
 
39
39
  Requires Node.js 18+.
40
40
 
41
+ ## Try in 5 minutes
42
+
43
+ 1. Install:
44
+
45
+ ```bash
46
+ npm install pompelmi
47
+ ```
48
+
49
+ 2. Create `scan-test.mjs`:
50
+
51
+ ```js
52
+ import { scanBytes } from "pompelmi";
53
+ import { readFileSync } from "node:fs";
54
+
55
+ const buffer = readFileSync("./package.json");
56
+
57
+ const report = await scanBytes(buffer, {
58
+ filename: "package.json",
59
+ mimeType: "application/json",
60
+ });
61
+
62
+ console.log("Verdict:", report.verdict);
63
+ console.log("Reasons:", report.reasons);
64
+ console.log("Duration:", report.durationMs, "ms");
65
+ ```
66
+
67
+ 3. Run it:
68
+
69
+ ```bash
70
+ node scan-test.mjs
71
+ ```
72
+
73
+ Next: see the demo under [examples/demo](./examples/demo) (upload route) or the docs [Getting started](https://pompelmi.github.io/pompelmi/getting-started/) guide.
74
+
41
75
  ## Quick Start
42
76
 
43
77
  ```ts
44
- import { scanBytes } from 'pompelmi';
78
+ import { scanBytes, STRICT_PUBLIC_UPLOAD } from "pompelmi";
45
79
 
46
80
  const report = await scanBytes(file.buffer, {
47
- ctx: {
48
- filename: file.originalname,
49
- mimeType: file.mimetype,
50
- size: file.size,
51
- },
81
+ filename: file.originalname,
82
+ mimeType: file.mimetype,
83
+ policy: STRICT_PUBLIC_UPLOAD,
84
+ failClosed: true,
52
85
  });
53
86
 
54
- if (!report.ok) {
87
+ if (report.verdict !== "clean") {
55
88
  return res.status(422).json({
56
- error: 'Upload blocked',
89
+ error: "Upload blocked",
57
90
  verdict: report.verdict,
58
91
  reasons: report.reasons,
59
92
  });
60
93
  }
61
94
  ```
62
95
 
96
+ ## Next steps
97
+
98
+ - [Documentation](https://pompelmi.github.io/pompelmi/)
99
+ - [Examples index](./examples/README.md)
100
+ - [Demo example](./examples/demo)
101
+ - [Contributing](./CONTRIBUTING.md)
102
+ - [Security](./SECURITY.md)
103
+ - [Roadmap](./ROADMAP.md)
104
+
63
105
  ## What Problem It Solves
64
106
 
65
107
  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 +148,6 @@ pnpm test
106
148
  pnpm build
107
149
  ```
108
150
 
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
151
  <!-- MENTIONS:START -->
118
152
 
119
153
  ## 🌟 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.9",
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",