
Product
Rust Support in Socket Is Now Generally Available
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.
edge-sentry-cli
Advanced tools
Catch Node-only APIs in Edge/serverless code before they hit prod.
Not affiliated with Sentry (the error tracker).
Edge runtimes (Vercel Edge Runtime, Cloudflare Workers, Deno Deploy, etc.) don’t ship Node’s standard library. A single fs import or process.env access hidden deep in a transitive dependency can:
runtime: 'edge'edge-sentry-cli statically scans your code and dependency graph, flags Node-only usage, and suggests Edge-safe fixes.
fs, path, crypto, stream, net, tls, http, https, zlib, child_process, cluster, worker_threads, dgram, dns, readline, repl, vm, perf_hooks, os, tty, module, url via node:url, etc.)process, Buffer (Node polyfill), global, global.require, __dirname, __filename in Edge-targeted coderequire(expr) with non-literal, or CommonJS interop that forces Node resolutionevents, buffer)Targets tune rule strictness. Example: global
crypto.subtleis OK (Web Crypto) butimport 'crypto'(Node) is not.
# Install
npm i -D edge-sentry-cli
# or
yarn add -D edge-sentry-cli
# or
pnpm add -D edge-sentry-cli
# Zero-config scan (auto-detects frameworks and Edge entrypoints)
edge-sentry-cli scan
# With a config file
edge-sentry-cli scan -c edgesentry.config.json
Recommended npm script
{
"scripts": {
"edge:scan": "edge-sentry-cli scan --ci"
}
}
edge-sentry-cli v0.1.0 • target(s): vercel-edge, cloudflare-workers
Scanning 231 files, 417 modules…
✖ 3 violations (2 error, 1 warn)
src/lib/upload.ts:12 node-builtins(fs)
Importing "fs" is not allowed in Edge targets (vercel-edge, cloudflare-workers).
10 | import fs from 'fs'
| ^^^^^^^
11 | import { put } from '@vercel/blob'
12 | // …
src/auth/session.ts:4 node-globals(process.env) (warn)
`process.env` is not available in Edge. Use platform secrets / runtime bindings.
node_modules/somepkg/index.js → transitive-builtins(crypto)
Dependency "somepkg@2.1.0" imports Node's "crypto". Replace or move usage off Edge.
Exit code: 1 (error violations found)
Create edgesentry.config.json (or .yaml).
{
"$schema": "https://unpkg.com/edge-sentry-cli/schema.json",
"targets": ["vercel-edge", "cloudflare-workers"],
"entry": [
"app/**",
"src/**",
"middleware.{ts,tsx,js}"
],
"ignore": ["**/*.test.*", "**/*.stories.*", "scripts/**"],
"rules": {
"node-builtins": "error",
"node-globals": "error",
"dynamic-require": "warn",
"cjs-in-edge": "warn",
"polyfill-leak": "warn"
},
"allow": {
"modules": [],
"globals": []
},
"resolve": {
"tsconfig": "./tsconfig.json",
"alias": {
"@": "./src"
}
},
"output": {
"format": "pretty",
"sarifFile": "./reports/edge-sentry.sarif"
},
"ci": {
"failOn": "warn"
}
}
vercel-edge – forbids all Node core modules/globalscloudflare-workers – forbids all Node core modules/globalsdeno-deploy – forbids Node core modules (unless using Deno's Node-compat, which is discouraged for Edge paths)generic-edge – strict superset (default when unknown)You can list multiple targets. The strictest rule wins.
Usage: edge-sentry [command] [options]
Commands:
scan Scan files & deps for Edge-incompatible code
explain <id> Explain a rule or violation id with suggestions
list-targets Print built-in targets and their constraints
print-config Show the resolved config
Options:
-c, --config <file> Path to config file
-p, --paths <globs> Glob(s) to scan (overrides config.entry)
--format <fmt> pretty | json | sarif (default: pretty)
--fail-on <level> none | warn | error (CI-friendly)
--cache Enable disk cache (default on in CI)
--max-warnings <n> Fail if warnings exceed n
-q, --quiet Only print violations
-v, --verbose Debug logging
-h, --help Show help
0 – no violations1 – error-level violations found2 – internal error (crash, bad config)node_modules (respects exports/conditions)No bundling; purely static analysis. Zero runtime hooks.
"edge:scan": "edge-sentry-cli scan --paths app/** middleware.ts" to your scriptsexport const runtime = 'edge' in route handlersmiddleware.tsimport crypto from 'crypto' with globalThis.crypto.subtleroute.ts with export const runtime = 'nodejs' or to server actions executed on Nodeprocess.envWeb Crypto / TextEncoder / ReadableStream| Node thing | Why it breaks on Edge | Edge-safe alternative | Example fix |
|---|---|---|---|
import fs from 'fs' | No filesystem | Use KV/blob/HTTP, or move to Node runtime | Use platform storage (Blob, KV) |
import crypto from 'crypto' | Node module missing | globalThis.crypto.subtle | await crypto.subtle.digest('SHA-256', data) |
process.env.X | process undefined | Platform secrets / env bindings | Inject via runtime env/bindings |
Buffer.from() | Node Buffer polyfill missing | TextEncoder / Uint8Array | new TextEncoder().encode(str) |
path.join() | Node path module missing | URL/strings | new URL('./file', import.meta.url) |
| CJS-only deps | Edge bundlers prefer ESM | Choose ESM build or alt package | import { ... } from 'pkg/esm' |
edge_scan:
stage: test
image: node:20-alpine
script:
- corepack enable
- yarn install --immutable --prefer-offline
- yarn edge:scan --format sarif --fail-on error
artifacts:
when: always
paths:
- reports/edge-sentry.sarif
expire_in: 1 week
allow_failure: false
- name: Edge safety scan
run: |
corepack enable
yarn install --immutable --prefer-offline
yarn edge:scan --format sarif --fail-on error
import { scan } from 'edge-sentry-cli';
const result = await scan({
targets: ['vercel-edge'],
entry: ['app/**', 'middleware.ts'],
});
if (result.errors.length) process.exit(1);
pnpm test / yarn testMIT © You and contributors
FAQs
Catch Node-only APIs in Edge/serverless code before they hit prod.
The npm package edge-sentry-cli receives a total of 0 weekly downloads. As such, edge-sentry-cli popularity was classified as not popular.
We found that edge-sentry-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.

Security News
Chrome 144 introduces the Temporal API, a modern approach to date and time handling designed to fix long-standing issues with JavaScript’s Date object.

Research
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.