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 5 packages

date-fns

✅ Works
v4.1.0 36,195,317 weekly downloads date-time
View Example
import { format, parseISO } from 'date-fns';

// Usage:
const date = parseISO('2026-01-08');
const formatted = format(date, 'yyyy-MM-dd');
return { success: formatted === '2026-01-08', result: formatted };

dayjs

✅ Works
v1.11.19 29,726,853 weekly downloads date-time
View Example
import dayjs from 'dayjs';

// Usage:
const date = dayjs('2026-01-08');
const formatted = date.format('YYYY-MM-DD');
return { success: formatted === '2026-01-08', result: formatted };

luxon

✅ Works
v3.7.2 17,010,440 weekly downloads date-time
View Example
import { DateTime } from 'luxon';

// Usage:
const dt = DateTime.fromISO('2026-01-08');
const formatted = dt.toFormat('yyyy-MM-dd');
return { success: formatted === '2026-01-08', result: formatted };

moment

✅ Works
v2.30.1 24,051,825 weekly downloads date-time

Consider using dayjs or date-fns for smaller bundle size

View Example
import moment from 'moment';

// Usage:
const date = moment('2026-01-08');
const formatted = date.format('YYYY-MM-DD');
return { success: formatted === '2026-01-08', result: formatted };
v0.6.0 11,577,434 weekly downloads date-time

Moment.js with timezone support. Works in Workers for date/time manipulation with timezone awareness.

View Example
import moment from 'moment-timezone';

// Usage:
const la = moment.tz('2026-01-08 12:00', 'America/Los_Angeles');
const tokyo = la.clone().tz('Asia/Tokyo');
return { success: true, result: { la: la.format(), tokyo: tokyo.format() } };

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.