
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@variablesoftware/mock-d1
Advanced tools
๐๏ธ๐๏ธ๐ง Mock D1 Database implementation for testing Cloudflare Workers
Mock Cloudflare D1 Database for unit and integration testing
๐๏ธ๐๏ธ๐ง @variablesoftware/mock-d1
provides an in-memory simulation of Cloudflare's D1 SQLite-compatible database. It enables fast, isolated, and predictable testing of SQL-backed applications without relying on external services.
pnpm add --dev @variablesoftware/mock-d1
This package assumes a test environment with Vitest and support for ESM.
import { mockD1Database } from "@variablesoftware/mock-d1";
const db = mockD1Database({
sessions: [{ sub: "user-123", jti: "token-abc", created: Date.now() }],
});
const stmt = db.prepare("SELECT * FROM sessions WHERE sub = ?");
stmt.bind("user-123");
const result = await stmt.all();
console.log(result.results); // [{ sub: 'user-123', ... }]
.prepare().bind().all()
and .run()
flow@variablesoftware/logface
SELECT
, INSERT
, UPDATE
, and DELETE
statements.dump()
method for snapshot inspectionD1Result
Tested using vitest run
, with coverage for:
mockD1Database()
with randomized insert/select/delete operations to simulate real query volumeD1Result
Run tests:
pnpm test
This package is under active development and not yet stable.
Once stable, it will be published as:
"@variablesoftware/mock-d1": "^0.5.0"
MIT ยฉ Rob Friedman / Variable Software
Built with โค๏ธ by @variablesoftware
Thank you for downloading and using this project. Pull requests are warmly welcomed!
FAQs
๐๏ธ๐๏ธ๐ง Mock D1 Database implementation for testing Cloudflare Workers
We found that @variablesoftware/mock-d1 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last weekโs supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.