Works on Workers

Discover which npm packages work in Cloudflare Workers. 395+ packages tested and working.

395+
Packages Working
992
Packages Tested
80
πŸ’‘ Alternatives

Browse by Category

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

@libsql/client

βœ… Works
v0.17.0 663,178 weekly downloads database

SQLite client for Turso and libSQL. Use with D1: createClient({ url: process.env.DATABASE_URL })

View Example
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' };
v1.0.2 866,469 weekly downloads database

Serverless Postgres driver for Neon. Works on Workers with HTTP connection pooling.

View Example
import { neon } from '@neondatabase/serverless';

// Usage:
const sql = neon('postgresql://user:pass@host/db');
return { success: typeof sql === 'function', result: 'Neon client created' };
v1.19.0 124,040 weekly downloads database

Serverless MySQL driver for PlanetScale. Works on Workers with HTTP connection.

View Example
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' };

drizzle-orm

βœ… Works
v0.45.1 3,424,449 weekly downloads database

TypeScript ORM with SQL-like syntax

View Example
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' };

elasticsearch

πŸ”„ Alternative Available
v16.7.3 296,894 weekly downloads database

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

ioredis

πŸ”„ Alternative Available
v5.9.1 9,966,692 weekly downloads database

Redis client for Node.js. Use Cloudflare Workers KV for key-value storage or @upstash/redis for Redis over HTTP.

πŸ’‘ Alternative: @upstash/redis

knex

πŸ”„ Alternative Available
vunknown 2,703,147 weekly downloads database

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

kysely

βœ… Works
v0.28.9 1,797,256 weekly downloads database

Type-safe SQL query builder - use with D1 database

View Example
import { Kysely, sql } from 'kysely';

// Usage:
return { success: typeof Kysely === 'function' && typeof sql === 'function', result: 'Kysely exports available' };

level

πŸ”„ Alternative Available
v10.0.0 304,383 weekly downloads database

LevelDB database abstraction

πŸ’‘ Alternative: @cloudflare/d1, @upstash/redis

Error: Package level needs manual test configuration - do not use generic Object.keys() test

leveldown

πŸ”„ Alternative Available
v6.1.1 411,095 weekly downloads database

LevelDB backend

πŸ’‘ Alternative: @cloudflare/d1, @upstash/redis

Error: Package leveldown needs manual test configuration - do not use generic Object.keys() test

levelup

πŸ”„ Alternative Available
v5.1.1 591,848 weekly downloads database

LevelDB wrapper

πŸ’‘ Alternative: @cloudflare/d1, @upstash/redis

Error: Package levelup needs manual test configuration - do not use generic Object.keys() test

lowdb

βœ… Works
v7.0.1 763,357 weekly downloads database

JSON database - works with custom adapters

View Example
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

πŸ”„ Alternative Available
v7.0.0 7,551,700 weekly downloads database

MongoDB driver - use D1 or @upstash/redis instead

πŸ’‘ Alternative: @cloudflare/d1, @upstash/redis

Error: Maximum call stack size exceeded

mongoose

πŸ”„ Alternative Available
v9.1.2 3,418,306 weekly downloads database

MongoDB ORM - use D1 with Drizzle ORM instead

πŸ’‘ Alternative: @cloudflare/d1, drizzle-orm

Error: Maximum call stack size exceeded

mssql

πŸ”„ Alternative Available
v12.2.0 1,188,341 weekly downloads database

Microsoft SQL Server driver - use D1 instead

πŸ’‘ Alternative: @cloudflare/d1

Error: Package mssql needs manual test configuration - do not use generic Object.keys() test

mysql2

πŸ”„ Alternative Available
v3.16.0 6,270,741 weekly downloads database

MySQL client requires TCP sockets

πŸ’‘ Alternative: D1 (SQLite on Cloudflare), @planetscale/database (HTTP-based MySQL)

nedb

πŸ”„ Alternative Available
v1.8.0 25,330 weekly downloads database

In-memory/file-based database

πŸ’‘ Alternative: D1 (SQLite), @upstash/redis, KV

pg

βœ… Works
v8.16.3 13,228,378 weekly downloads database

PostgreSQL client for Node.js. Use @neondatabase/serverless or Hyperdrive for Workers

View Example
import pkg from 'pg';

// Usage:
const { Client } = pkg;
const client = new Client({ connectionString: 'postgresql://test' });
return { success: typeof client.connect === 'function', result: { hasClient: true } };

redis

βœ… Works
v5.10.0 6,268,890 weekly downloads database

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 ':'

View Example
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 };

sequelize

πŸ”„ Alternative Available
v6.37.7 2,168,919 weekly downloads database

Node.js ORM - use D1 with @cloudflare/d1 instead

πŸ’‘ Alternative: @cloudflare/d1

sqlite3

πŸ”„ Alternative Available
v5.1.7 1,393,075 weekly downloads database

Native C++ module - use D1 or @libsql/client instead

πŸ’‘ Alternative: D1/@libsql/client

Common Questions

Why are so many packages marked "Build/Dev Tool"?

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.

Can I use Express/Koa/Hapi in Workers?

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.

What about databases like PostgreSQL or MySQL?

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.

Why doesn't package X work?

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.