Discover which npm packages work in Cloudflare Workers. 395+ packages tested and working.
Showing runtime packages only. Build tools, CLI tools, and test frameworks are hidden by default.
Enable "Show build tools & incompatible" to see all 992 tested packages.
Showing 21 packages
SQLite client for Turso and libSQL. Use with D1: createClient({ url: process.env.DATABASE_URL })
import { createClient } from '@libsql/client';
// Usage:
// Test client creation and API surface
const client = createClient({ url: 'libsql://fake-host.turso.io' });
return { success: typeof client.execute === 'function' && typeof client.batch === 'function', result: 'libSQL client created' };
Serverless Postgres driver for Neon. Works on Workers with HTTP connection pooling.
import { neon } from '@neondatabase/serverless';
// Usage:
const sql = neon('postgresql://user:pass@host/db');
return { success: typeof sql === 'function', result: 'Neon client created' };
Serverless MySQL driver for PlanetScale. Works on Workers with HTTP connection.
import { connect } from '@planetscale/database';
// Usage:
const conn = connect({ url: 'mysql://user:pass@host/db' });
return { success: typeof conn.execute === 'function', result: 'PlanetScale client created' };
TypeScript ORM with SQL-like syntax
import { sql } from 'drizzle-orm';
// Usage:
const query = sql`SELECT * FROM users WHERE id = ${123}`;
return { success: query.queryChunks.length > 0, result: 'SQL query built' };
DEPRECATED package (no longer maintained since 2020). Official legacy Elasticsearch JavaScript client for connecting to Elasticsearch servers via HTTP REST API. Replaced by @elastic/elasticsearch (the new official client). The old client is no longer maintained and users are strongly advised to migrate to the new client. While theoretically an HTTP REST client could work in Workers, this legacy package is unmaintained and has compatibility issues. Original error 'Cannot read properties of undefined (reading 'bold')' occurred due to outdated dependencies and lack of maintenance.
π‘ Alternative: @elastic/elasticsearch (new official client) - may work with Workers, needs testing
Redis client for Node.js. Use Cloudflare Workers KV for key-value storage or @upstash/redis for Redis over HTTP.
π‘ Alternative: @upstash/redis
SQL query builder - use D1 or Hyperdrive
π‘ Alternative: @cloudflare/d1
Error: Command failed: npm install npm warn deprecated rollup-plugin-inject@3.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject. npm warn deprecated sourcema
Type-safe SQL query builder - use with D1 database
import { Kysely, sql } from 'kysely';
// Usage:
return { success: typeof Kysely === 'function' && typeof sql === 'function', result: 'Kysely exports available' };
LevelDB database abstraction
π‘ Alternative: @cloudflare/d1, @upstash/redis
Error: Package level needs manual test configuration - do not use generic Object.keys() test
LevelDB backend
π‘ Alternative: @cloudflare/d1, @upstash/redis
Error: Package leveldown needs manual test configuration - do not use generic Object.keys() test
LevelDB wrapper
π‘ Alternative: @cloudflare/d1, @upstash/redis
Error: Package levelup needs manual test configuration - do not use generic Object.keys() test
JSON database - works with custom adapters
import { Low } from 'lowdb';
// Usage:
const db = new Low({ read: async () => ({ posts: [] }), write: async () => {} }, { posts: [] });
await db.read();
return { success: Array.isArray(db.data.posts), result: db.data };
MongoDB driver - use D1 or @upstash/redis instead
π‘ Alternative: @cloudflare/d1, @upstash/redis
Error: Maximum call stack size exceeded
MongoDB ORM - use D1 with Drizzle ORM instead
π‘ Alternative: @cloudflare/d1, drizzle-orm
Error: Maximum call stack size exceeded
Microsoft SQL Server driver - use D1 instead
π‘ Alternative: @cloudflare/d1
Error: Package mssql needs manual test configuration - do not use generic Object.keys() test
MySQL client requires TCP sockets
π‘ Alternative: D1 (SQLite on Cloudflare), @planetscale/database (HTTP-based MySQL)
In-memory/file-based database
π‘ Alternative: D1 (SQLite), @upstash/redis, KV
PostgreSQL client for Node.js. Use @neondatabase/serverless or Hyperdrive for Workers
import pkg from 'pg';
// Usage:
const { Client } = pkg;
const client = new Client({ connectionString: 'postgresql://test' });
return { success: typeof client.connect === 'function', result: { hasClient: true } };
Official Redis client for Node.js. Works with TCP connections in Workers. Consider @upstash/redis for HTTP-based Redis.
π‘ Alternative: @upstash/redis
Error: Unexpected token ':'
import { createClient } from 'redis';
const client = createClient({ url: 'redis://your-redis-server:6379' });
await client.connect();
await client.set('key', 'value');
const value = await client.get('key');
return { success: true, value };
Node.js ORM - use D1 with @cloudflare/d1 instead
π‘ Alternative: @cloudflare/d1
Native C++ module - use D1 or @libsql/client instead
π‘ Alternative: D1/@libsql/client
Many popular npm packages are build tools (webpack, babel), test frameworks (jest, mocha), or CLI utilities (chalk, commander) that run during developmentβnot in production. Cloudflare Workers is a runtime environment for production code. These tools still work great for building your Workers project, they just don't run inside Workers themselves.
Yes! As of September 2025, Workers supports node:http server APIs.
Use httpServerHandler from cloudflare:node to wrap Express, Koa, or other Node.js HTTP frameworks.
For new projects, we recommend lightweight alternatives like Hono or itty-router which are built for edge environments.
Workers supports database clients like pg (PostgreSQL) and mysql2 when connecting to public endpoints.
For production, use edge-optimized solutions: Cloudflare D1 (SQLite), Neon (serverless Postgres), PlanetScale (MySQL), or Upstash Redis.
Common reasons: Native modules (C++ bindings like sharp, bcrypt) don't workβuse alternatives like bcryptjs or Cloudflare Images.
Filesystem access (fs module for local files) isn't availableβuse KV, R2, or D1 instead.
TCP sockets (raw socket.io, redis) aren't supportedβuse Durable Objects, WebSockets, or HTTP-based alternatives.