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 5 packages
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 };
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 };
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 };
Consider using dayjs or date-fns for smaller bundle size
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 };
Moment.js with timezone support. Works in Workers for date/time manipulation with timezone awareness.
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() } };
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.