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 22 packages
GitHub API client - works on Workers
import { Octokit } from '@octokit/rest';
// Usage:
const octokit = new Octokit();
const { data } = await octokit.rest.repos.get({ owner: 'cloudflare', repo: 'workers-sdk' });
return { success: data.name === 'workers-sdk', result: data.name };
apollo-client v2 is deprecated. It was the old GraphQL client for React apps, split into multiple npm packages (apollo-client, apollo-cache-inmemory, apollo-link-http, graphql-tag). Primarily designed for browser/React environments. Replaced by the unified @apollo/client v3+ package.
π‘ Alternative: @apollo/client
apollo-link is the core interface/base class for Apollo Client v2's modular link architecture (apollo-link, apollo-link-http, apollo-link-ws, apollo-link-state, etc.). Published 6 years ago (2018) as part of the split Apollo Client v2 system where each transport/middleware was a separate package. Apollo Client v3+ (released 2020) unified all these packages into a single @apollo/client package with better TypeScript support, improved caching, and modern React hooks. This package is deprecated infrastructure - use @apollo/client instead.
π‘ Alternative: @apollo/client
Part of deprecated Apollo Client v2 modular architecture (apollo-client, apollo-link, apollo-link-http, apollo-cache-inmemory). Apollo Client v3+ unified these packages into a single @apollo/client package with better TypeScript support, improved developer experience, and modern GraphQL features. apollo-link-http was the HTTP transport layer for sending GraphQL queries over HTTP in Apollo v2.
π‘ Alternative: @apollo/client
Popular HTTP client. Works on Workers with nodejs_compat. Consider using native fetch() for simpler use cases.
π‘ Alternative: built-in: fetch
import axios from 'axios';
// Make HTTP requests
const response = await axios.get('https://api.example.com/data');
return { success: response.status === 200, data: response.data };
import contentType from 'content-type';
// Usage:
const result = contentType.parse('text/html; charset=utf-8');
return { success: result.type === 'text/html', result };
HTTP cookie parsing/serialization
import cookie from 'cookie';
// Usage:
const result = cookie.parse('foo=bar; baz=qux');
return { success: result.foo === 'bar' && result.baz === 'qux', result };
CORS middleware for Express/Connect. Works with httpServerHandler.
import { httpServerHandler } from 'cloudflare:node';
import express from 'express';
import cors from 'cors';
const app = express();
app.use(cors({ origin: 'https://example.com', methods: ['GET', 'POST'] }));
app.get('/api', (req, res) => res.json({ data: 'test' }));
app.listen(3000);
export default httpServerHandler({ port: 3000 });
Universal fetch API polyfill
import fetch from 'cross-fetch';
// Usage:
const result = await fetch('https://httpbin.org/get');
const data = await result.json();
return { success: result.ok, result: { status: result.status } };
Express middleware for session management
import session from 'express-session';
// Usage:
const middleware = session({ secret: 'test', resave: false, saveUninitialized: true });
return { success: typeof middleware === 'function', result: 'session middleware created' };
Multipart/form-data encoding
import FormData from 'form-data';
// Usage:
const form = new FormData();
form.append('key', 'value');
return { success: true, result: 'FormData created' };
Parse X-Forwarded-For header
import forwarded from 'forwarded';
// Usage:
const req = {
headers: { 'x-forwarded-for': '192.168.1.1, 10.0.0.1' },
connection: { remoteAddress: '127.0.0.1' }
};
const addresses = forwarded(req);
return { success: Array.isArray(addresses) && addresses.length === 3, result: addresses };
HTTP(S) proxy agent. Creates agent but Workers fetch() does not use Node.js agents - limited practical use.
import { HttpsProxyAgent } from 'https-proxy-agent';
// Usage:
const agent = new HttpsProxyAgent('http://proxy.example.com:8080');
return { success: agent.proxy.hostname === 'proxy.example.com', result: { host: agent.proxy.hostname, port: agent.proxy.port } };
Incompatible node:url APIs (url.parse)
π‘ Alternative: fetch or ky
Error: url.parse is not a function
Tiny HTTP client based on fetch. Excellent for Workers - small bundle, modern API.
import ky from 'ky';
const data = await ky.get('https://api.example.com/data').json();
const posted = await ky.post('https://api.example.com/items', { json: { name: 'test' } }).json();
return { success: true, data };
Workers has native fetch() - no need for this package
π‘ Alternative: built-in: fetch
import fetch from 'node-fetch';
// Usage:
return { success: true, result: 'Use native fetch instead' };
Old HTTP client - use native fetch or modern alternatives
π‘ Alternative: fetch/ky/hono
HTTP client library - import issues with Workers runtime
π‘ Alternative: fetch API, ky, or ofetch
Error: request2.agent is not a function
HTTP cookie parsing and storage
import { Cookie } from 'tough-cookie';
// Usage:
const cookie = Cookie.parse('foo=bar; Path=/; Domain=example.com');
return { success: cookie && cookie.key === 'foo' && cookie.value === 'bar', result: { key: cookie?.key, value: cookie?.value } };
Use native fetch() API in Workers
Old XHR polyfill, requires child_process
π‘ Alternative: fetch API (built-in)
Error: No such module "node:child_process".
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.