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

@octokit/rest

βœ… Works
v22.0.1 9,680,244 weekly downloads http-client

GitHub API client - works on Workers

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

πŸ”„ Alternative Available
v2.6.10 360,457 weekly downloads http-client

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

πŸ”„ Alternative Available
v1.2.14 1,020,999 weekly downloads http-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

apollo-link-http

πŸ”„ Alternative Available
v1.5.17 463,252 weekly downloads http-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

axios

βœ… Works
v1.13.2 69,395,923 weekly downloads http-client

Popular HTTP client. Works on Workers with nodejs_compat. Consider using native fetch() for simpler use cases.

πŸ’‘ Alternative: built-in: fetch

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

content-type

βœ… Works
v1.0.5 45,890,252 weekly downloads http-client
View Example
import contentType from 'content-type';

// Usage:
const result = contentType.parse('text/html; charset=utf-8');
return { success: result.type === 'text/html', result };

cookie

βœ… Works
v1.1.1 85,789,258 weekly downloads http-client

HTTP cookie parsing/serialization

View Example
import cookie from 'cookie';

// Usage:
const result = cookie.parse('foo=bar; baz=qux');
return { success: result.foo === 'bar' && result.baz === 'qux', result };

cors

βœ… Works
v2.8.5 24,977,922 weekly downloads http-client

CORS middleware for Express/Connect. Works with httpServerHandler.

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

cross-fetch

βœ… Works
v4.1.0 22,143,053 weekly downloads http-client

Universal fetch API polyfill

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

βœ… Works
v1.18.2 2,925,235 weekly downloads http-client

Express middleware for session management

View Example
import session from 'express-session';

// Usage:
const middleware = session({ secret: 'test', resave: false, saveUninitialized: true });
return { success: typeof middleware === 'function', result: 'session middleware created' };

form-data

βœ… Works
v4.0.5 100,274,410 weekly downloads http-client

Multipart/form-data encoding

View Example
import FormData from 'form-data';

// Usage:
const form = new FormData();
form.append('key', 'value');
return { success: true, result: 'FormData created' };

forwarded

βœ… Works
v0.2.0 40,893,666 weekly downloads http-client

Parse X-Forwarded-For header

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

https-proxy-agent

βœ… Works
v7.0.6 99,989,345 weekly downloads http-client

HTTP(S) proxy agent. Creates agent but Workers fetch() does not use Node.js agents - limited practical use.

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

hyperquest

πŸ”„ Alternative Available
v2.1.3 122,997 weekly downloads http-client

Incompatible node:url APIs (url.parse)

πŸ’‘ Alternative: fetch or ky

Error: url.parse is not a function

ky

βœ… Works
v1.14.2 4,520,638 weekly downloads http-client

Tiny HTTP client based on fetch. Excellent for Workers - small bundle, modern API.

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

needle

πŸ”„ Alternative Available
v3.3.1 8,808,034 weekly downloads http-client

HTTP client

πŸ’‘ Alternative: fetch (built-in), ky, undici

node-fetch

πŸ”„ Alternative Available
v3.3.2 82,323,175 weekly downloads http-client

Workers has native fetch() - no need for this package

πŸ’‘ Alternative: built-in: fetch

View Example
import fetch from 'node-fetch';

// Usage:
return { success: true, result: 'Use native fetch instead' };

restler

πŸ”„ Alternative Available
v3.4.0 13,472 weekly downloads http-client

Old HTTP client - use native fetch or modern alternatives

πŸ’‘ Alternative: fetch/ky/hono

superagent

πŸ”„ Alternative Available
v10.3.0 12,440,294 weekly downloads http-client

HTTP client library - import issues with Workers runtime

πŸ’‘ Alternative: fetch API, ky, or ofetch

Error: request2.agent is not a function

tough-cookie

βœ… Works
v6.0.0 55,054,014 weekly downloads http-client

HTTP cookie parsing and storage

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

undici

🏠 Built into Workers
v7.18.2 33,229,627 weekly downloads http-client

Use native fetch() API in Workers

xmlhttprequest

πŸ”„ Alternative Available
v1.8.0 1,168,463 weekly downloads http-client

Old XHR polyfill, requires child_process

πŸ’‘ Alternative: fetch API (built-in)

Error: No such module "node:child_process".

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.