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

@apidevtools/swagger-parser

⚠️ Works (with notes)
v12.1.0 3,050,382 weekly downloads validation

OpenAPI/Swagger parser. parse() and dereference() work, but validate() fails because it uses ajv internally (code generation). Use for parsing specs, not validation.

View Example
import SwaggerParser from '@apidevtools/swagger-parser';

// Usage: Parse OpenAPI/Swagger specs (validation uses ajv which fails)
const spec = {
  openapi: '3.0.0',
  info: { title: 'My API', version: '1.0.0' },
  paths: { '/users': { get: { responses: { '200': { description: 'OK' } } } } }
};
const parsed = await SwaggerParser.parse(spec);
return { success: true, result: { title: parsed.info.title } };

@emotion/core

πŸ”„ Alternative Available
v11.0.0 1,574,672 weekly downloads css-in-js

@emotion/core is deprecated and was replaced by @emotion/react in Emotion v11. Emotion is a CSS-in-JS library for React that requires browser/DOM APIs (document, window, HTMLElement) and React runtime for styling components. It's designed for client-side browser rendering with features like the css prop, styled components, theming, and dynamic styles. Not suitable for Workers serverless environment which has no DOM. For styling in Workers SSR, pre-generate styles at build time or use edge-compatible CSS solutions.

πŸ’‘ Alternative: @emotion/react (though also requires browser/React - neither work on Workers)

v7.1.0 1,977,451 weekly downloads ui

Works for server-side SVG generation, but DOM manipulation features require browser

View Example
import { library, icon } from '@fortawesome/fontawesome-svg-core';
import { faUser } from '@fortawesome/free-solid-svg-icons';

// Usage:
library.add(faUser);
const result = icon({ prefix: 'fas', iconName: 'user' });
const svg = result?.html?.[0];
return { success: svg?.includes('<svg') && svg?.includes('data-icon="user"'), result: { length: svg?.length } };
v7.1.0 1,896,368 weekly downloads ui

Icon definitions for Font Awesome, works in Workers

View Example
import { faUser, faHeart, faCheck } from '@fortawesome/free-solid-svg-icons';

// Usage:
const hasCorrectStructure = faUser.prefix === 'fas' && 
  faUser.iconName === 'user' && 
  Array.isArray(faUser.icon);
return { success: hasCorrectStructure, result: { icons: ['faUser', 'faHeart', 'faCheck'], prefix: faUser.prefix } };
v10.0.31 10,962,054 weekly downloads utility

Create executable GraphQL schemas. Merges type definitions and resolvers.

View Example
import { makeExecutableSchema } from '@graphql-tools/schema';

// Usage:
const typeDefs = 'type Query { hello: String }';
const resolvers = { Query: { hello: () => 'world' } };
const schema = makeExecutableSchema({ typeDefs, resolvers });
return { success: schema.getQueryType()?.name === 'Query', result: 'Schema created' };

@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' };

@msgpack/msgpack

βœ… Works
v3.1.3 1,401,673 weekly downloads encoding

MessagePack binary serialization - typically 25-50% smaller than JSON. Supports typed arrays, Maps, and custom extensions. Great for efficient data transfer between Workers and clients/APIs.

View Example
import { encode, decode } from '@msgpack/msgpack';

export default {
  async fetch(request) {
    // Encode complex data
    const data = {
      name: 'User',
      nested: { foo: 'bar', num: 42 },
      tags: ['worker', 'test'],
      binary: new Uint8Array([1, 2, 3, 4, 5])
    };
    
    const encoded = encode(data);
    const decoded = decode(encoded);
    
    // MessagePack is ~25% smaller than JSON
    const jsonSize = JSON.stringify(data).length;
    const msgpackSize = encoded.byteLength;
    
    return Response.json({
      decoded,
      compression: `${msgpackSize}/${jsonSize} bytes (${(msgpackSize/jsonSize*100).toFixed(0)}%)`
    });
  }
};
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' };

@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 };
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' };

accepts

βœ… Works
v1.3.8 54,884,920 weekly downloads http

HTTP content negotiation library. Parses Accept headers for content-type negotiation.

View Example
import accepts from 'accepts';

// Usage:
const accept = accepts(request);
const type = accept.type(['json', 'html']);
return { success: true, result: { preferredType: type } };

acorn

βœ… Works
v8.15.0 115,531,955 weekly downloads utility

JavaScript parser producing AST. Supports ES2022+ including private fields, optional chaining, nullish coalescing, and ESM syntax. Useful for code analysis, transformation, or building dev tools in Workers.

View Example
import * as acorn from 'acorn';

export default {
  async fetch(request) {
    // Parse ES modules with modern syntax
    const code = `
      import { foo } from './bar';
      const obj = { a: 1, ...other };
      const fn = async () => await fetch('/api');
      class Foo { static bar = 42; }
    `;
    
    const ast = acorn.parse(code, { 
      ecmaVersion: 2022, 
      sourceType: 'module' 
    });
    
    return Response.json({
      type: ast.type,
      statements: ast.body.length,
      firstNode: ast.body[0].type
    });
  }
};

adm-zip

⚠️ Works (with notes)
v0.5.16 8,755,903 weekly downloads compression

ZIP creation works perfectly. Extraction/decompression fails with 'Memory limit exceeded' error due to zlib constraints in Workers. Use for creating ZIPs only - for extraction, consider streaming or using R2/external storage.

View Example
import AdmZip from 'adm-zip';

// Creating ZIP works:
const zip = new AdmZip();
zip.addFile('hello.txt', Buffer.from('Hello from Workers!'));
zip.addFile('data.json', Buffer.from(JSON.stringify({ test: true })));
const zipBuffer = zip.toBuffer();

// Return as downloadable ZIP:
return new Response(zipBuffer, {
  headers: {
    'Content-Type': 'application/zip',
    'Content-Disposition': 'attachment; filename="archive.zip"'
  }
});

amqplib

⚠️ Works (with notes)
v0.10.9 1,688,963 weekly downloads messaging

AMQP client for RabbitMQ. Loads but requires TCP connection. Use Cloudflare Queues for message queuing in Workers.

View Example
import amqp from 'amqplib';

// Usage: Create credentials (actual connection needs TCP to RabbitMQ)
const credentials = amqp.credentials.plain('user', 'pass');
return { success: credentials.mechanism === 'PLAIN', result: { mechanism: credentials.mechanism, note: 'Use Cloudflare Queues instead' } };

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

assert

🏠 Built into Workers
v2.1.0 12,367,210 weekly downloads built-in

Built-in Node.js assert module

assert-plus

βœ… Works
v1.0.0 19,410,392 weekly downloads validation

Extra assertions on top of Node.js assert module - provides type checking utilities

View Example
import assert from 'assert-plus';

// Usage:
assert.string('hello', 'value');
assert.number(42, 'value');
assert.object({ foo: 'bar' }, 'value');
return { success: true, result: 'All assertions passed' };

async

βœ… Works
v3.2.6 62,844,090 weekly downloads utility

Async utilities for control flow

View Example
import async from 'async';

// Usage:
const results = await async.parallel([
  async () => 1,
  async () => 2,
  async () => 3,
]);
return { success: results[0] === 1 && results[1] === 2 && results[2] === 3, result: results };

async-retry

βœ… Works
v1.3.3 13,841,120 weekly downloads async

Retry async operations with exponential backoff. Supports bail() to abort retries on fatal errors, configurable timeout/factor. Perfect for resilient API calls in Workers.

View Example
import retry from 'async-retry';

export default {
  async fetch(request) {
    // Retry with exponential backoff
    const result = await retry(async (bail, attemptNumber) => {
      const response = await fetch('https://api.example.com/data');
      
      // Use bail() to stop retrying on fatal errors
      if (response.status === 401) {
        bail(new Error('Unauthorized - no point retrying'));
        return;
      }
      
      if (!response.ok) throw new Error(`Attempt ${attemptNumber} failed`);
      return response.json();
    }, {
      retries: 5,
      minTimeout: 100,
      maxTimeout: 1000,
      factor: 2
    });
    
    return Response.json(result);
  }
};

async-validator

βœ… Works
v4.2.5 1,297,309 weekly downloads validation

Async form validation library - commonly used with Ant Design forms

View Example
import Schema from 'async-validator';

// Usage:
const descriptor = {
  name: { type: 'string', required: true, message: 'Name is required' },
  age: { type: 'number', min: 0, max: 120 }
};
const validator = new Schema(descriptor);
const result = await validator.validate({ name: 'Alice', age: 30 });
return { success: true, result };

aws-sdk

πŸ”„ Alternative Available
v2.1693.0 7,899,779 weekly downloads cloud-services

aws-sdk (v2) is the legacy monolithic AWS SDK for JavaScript - now deprecated and replaced by AWS SDK v3. v2 requires node:punycode which isn't available in Workers' nodejs_compat. More importantly, AWS SDK v2 is a massive monolithic package importing ALL AWS services (~50MB+), making it unsuitable for edge/serverless. AWS SDK v3 (@aws-sdk/client-s3, @aws-sdk/client-dynamodb, @aws-sdk/client-sqs, etc.) is modular, tree-shakeable, and specifically designed to work in browser/edge environments including Workers. Use the specific @aws-sdk/client-* packages for the AWS services you need.

πŸ’‘ Alternative: @aws-sdk/client-* (AWS SDK v3)

Error: No such module "node:punycode".

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

base-64

βœ… Works
v1.0.0 3,696,712 weekly downloads string

JavaScript base64 encoder/decoder. Workers also has native atob()/btoa() functions.

View Example
import base64 from 'base-64';

// Usage:
const encoded = base64.encode('Hello, World!');
const decoded = base64.decode(encoded);
return { success: decoded === 'Hello, World!', result: { encoded, decoded } };

base64-js

βœ… Works
v1.5.1 59,698,861 weekly downloads encoding

Base64 encoding/decoding

View Example
import * as base64 from 'base64-js';

// Usage:
const text = 'Hello World!';
const bytes = new TextEncoder().encode(text);
const encoded = base64.fromByteArray(bytes);
const decoded = base64.toByteArray(encoded);
const result = new TextDecoder().decode(decoded);
return { success: result === text, result: { encoded, decoded: result } };

basic-auth

βœ… Works
v2.0.1 11,158,506 weekly downloads utility

HTTP Basic Authentication parser - parses Authorization header to extract credentials

View Example
import auth from 'basic-auth';

// Usage:
// Simulate an HTTP request with Basic Auth header
const credentials = btoa('user:pass'); // Base64 encode 'user:pass'
const mockRequest = {
  headers: {
    authorization: `Basic ${credentials}`
  }
};
const parsed = auth(mockRequest);
return { success: parsed?.name === 'user' && parsed?.pass === 'pass', result: parsed };

bcrypt

πŸ”„ Alternative Available
v6.0.0 3,007,621 weekly downloads crypto

bcrypt is a native module with C++ bindings that requires node:os and won't work in Workers. Use bcryptjs (pure JS implementation) or @cloudflare/workers-bcrypt (optimized for Workers) instead.

πŸ’‘ Alternative: bcryptjs or @cloudflare/workers-bcrypt

Error: No such module "node:os".

bcrypt-nodejs

πŸ”„ Alternative Available
v0.0.3 43,497 weekly downloads crypto

bcrypt-nodejs is deprecated and unmaintained since 2013. The package explicitly recommends using bcrypt or bcryptjs instead (see https://github.com/kelektiv/node.bcrypt.js/wiki/bcrypt-vs-brypt.js). While bcrypt-nodejs is pure JavaScript and might technically work, the recommended alternative bcryptjs works perfectly on Workers and is actively maintained.

πŸ’‘ Alternative: bcryptjs

bcryptjs

βœ… Works
v3.0.3 4,704,231 weekly downloads crypto

Pure JavaScript bcrypt implementation - perfect alternative to native bcrypt which doesn't work on Workers. Both sync and async methods work. Use saltRounds of 10-12 for good security/performance balance.

View Example
import bcrypt from 'bcryptjs';

export default {
  async fetch(request) {
    const password = 'mypassword123';
    
    // Hash password (both sync and async work)
    const salt = bcrypt.genSaltSync(10);
    const hash = bcrypt.hashSync(password, salt);
    
    // Or use async versions
    const asyncHash = await bcrypt.hash(password, 10);
    
    // Verify password
    const isValid = bcrypt.compareSync(password, hash);
    const asyncValid = await bcrypt.compare(password, asyncHash);
    
    return Response.json({ hash, isValid, asyncValid });
  }
};

big.js

βœ… Works
v7.0.1 22,121,849 weekly downloads math

Arbitrary-precision decimal arithmetic

View Example
import Big from 'big.js';

// Usage:
const x = new Big('0.1');
const y = new Big('0.2');
const sum = x.plus(y);
return { success: sum.toString() === '0.3', result: sum.toString() };

bignumber.js

βœ… Works
v9.3.1 23,509,813 weekly downloads math

Arbitrary-precision decimal and non-decimal arithmetic

View Example
import BigNumber from 'bignumber.js';

// Usage:
const x = new BigNumber('0.1');
const y = new BigNumber('0.2');
const sum = x.plus(y);
return { success: sum.toString() === '0.3', result: sum.toString() };

bip39

βœ… Works
v3.1.0 543,464 weekly downloads crypto

Bitcoin BIP39 mnemonic code library. Generate and validate seed phrases.

View Example
import * as bip39 from 'bip39';

// Usage:
const mnemonic = bip39.generateMnemonic();
const isValid = bip39.validateMnemonic(mnemonic);
return { success: isValid, result: { wordCount: mnemonic.split(' ').length } };

bl

βœ… Works
v6.1.6 43,595,683 weekly downloads utility

Buffer List - collect and manage multiple buffers as one contiguous buffer.

View Example
import bl from 'bl';

// Usage:
const list = new bl();
list.append(Buffer.from('Hello '));
list.append(Buffer.from('World'));
const result = list.toString();
return { success: result === 'Hello World', result: { text: result, length: list.length } };

bluebird

βœ… Works
v3.7.2 30,031,991 weekly downloads utility

Feature-rich Promise library with utilities like map (with concurrency), filter, reduce, props, some, any, delay, and more. All features work on Workers.

View Example
import Promise from 'bluebird';

export default {
  async fetch(request) {
    // Promise.map with concurrency control
    const items = [1, 2, 3, 4, 5];
    const mapped = await Promise.map(items, async (n) => {
      await Promise.delay(10);
      return n * 2;
    }, { concurrency: 2 });
    
    // Promise.props - resolve object of promises
    const props = await Promise.props({
      a: Promise.resolve(1),
      b: Promise.delay(10).then(() => 2)
    });
    
    // Promise.filter, Promise.reduce
    const filtered = await Promise.filter(items, n => n % 2 === 0);
    const sum = await Promise.reduce(items, (acc, n) => acc + n, 0);
    
    return Response.json({ mapped, props, filtered, sum });
  }
};

bn.js

βœ… Works
v5.2.2 39,082,947 weekly downloads math

Big number library for arbitrary-precision integer arithmetic.

View Example
import BN from 'bn.js';

// Usage:
const a = new BN('1234567890123456789');
const b = new BN('9876543210987654321');
const sum = a.add(b);
return { success: sum.toString() === '11111111101111111110', result: sum.toString() };

body-parser

βœ… Works
v2.2.2 56,702,665 weekly downloads utility

Express middleware for parsing request bodies. Use with httpServerHandler from cloudflare:node for Express compatibility, or use native Request.json()/Request.text() for simpler cases.

View Example
import bodyParser from 'body-parser';

// Usage: Express middleware for parsing request bodies
// Use with httpServerHandler from cloudflare:node for Express apps
const jsonParser = bodyParser.json();
const urlencodedParser = bodyParser.urlencoded({ extended: true });
return { success: true, result: 'Middleware created' };

boom

βœ… Works
v7.3.0 1,591,020 weekly downloads utility

HTTP-friendly error objects with proper status codes, messages, and error payloads. Supports notFound(), unauthorized(), badRequest(), forbidden(), conflict(), internal(), teapot(), and more. Use Boom.isBoom() to detect Boom errors.

View Example
import Boom from 'boom';

export default {
  async fetch(request) {
    const url = new URL(request.url);
    
    try {
      if (url.pathname === '/protected') {
        throw Boom.unauthorized('Authentication required');
      }
      if (url.pathname === '/missing') {
        throw Boom.notFound('Resource not found', { id: 123 });
      }
      return Response.json({ message: 'OK' });
    } catch (error) {
      if (Boom.isBoom(error)) {
        return Response.json(error.output.payload, {
          status: error.output.statusCode,
          headers: error.output.headers
        });
      }
      throw error;
    }
  }
};

bottleneck

βœ… Works
v2.19.5 4,690,105 weekly downloads async

Rate limiter and task scheduler. Control concurrency and request rates.

View Example
import Bottleneck from 'bottleneck';

// Usage:
const limiter = new Bottleneck({ maxConcurrent: 1, minTime: 100 });
const result = await limiter.schedule(() => Promise.resolve('done'));
return { success: result === 'done', result };

bs58

βœ… Works
v6.0.0 4,921,914 weekly downloads encoding

Base58 encoding/decoding - commonly used in Bitcoin, IPFS, and other blockchain applications.

View Example
import bs58 from 'bs58';

// Usage:
const bytes = new Uint8Array([1, 2, 3, 4, 5]);
const encoded = bs58.encode(bytes);
const decoded = bs58.decode(encoded);
return { success: decoded.length === 5 && decoded[0] === 1, result: { encoded, decoded: Array.from(decoded) } };

bson

βœ… Works
v7.0.0 7,798,627 weekly downloads encoding

MongoDB BSON serialization with full support for ObjectId, Binary, UUID, Date, and other BSON types. Use for MongoDB-compatible data or efficient binary serialization. EJSON support for JSON-compatible output.

View Example
import { BSON, ObjectId, Binary, UUID, serialize, deserialize } from 'bson';

export default {
  async fetch(request) {
    // Create MongoDB-compatible documents
    const doc = {
      _id: new ObjectId(),
      name: 'Document',
      data: new Binary(Buffer.from('binary data')),
      uuid: new UUID(),
      created: new Date()
    };
    
    // Serialize/deserialize
    const bsonData = serialize(doc);
    const restored = deserialize(bsonData);
    
    // EJSON for JSON-compatible output
    const ejson = BSON.EJSON.stringify(doc);
    
    return Response.json({ restored, ejson });
  }
};

btoa

🏠 Built into Workers
v1.2.1 5,221,339 weekly downloads encoding

btoa() is a native Web API function for base64 encoding (binary-to-ASCII) that's already built into Cloudflare Workers. The 'btoa' npm package was created as a polyfill for Node.js environments that didn't have btoa natively. Workers provides native btoa()/atob() functions - no package installation needed. Simply use: btoa('hello') to encode, atob('aGVsbG8=') to decode.

buffer

βœ… Works
v6.0.3 88,241,229 weekly downloads utility

Node.js Buffer polyfill. Use built-in Workers Buffer or Uint8Array when possible.

View Example
import { Buffer } from 'buffer';

// Usage:
const buf = Buffer.from('hello world', 'utf-8');
const hex = buf.toString('hex');
const base64 = buf.toString('base64');
return { success: hex.length === 22 && base64.length === 16, result: { hex, base64 } };

bunyan

πŸ”„ Alternative Available
v1.8.15 2,186,407 weekly downloads logging

Bunyan is a JSON logging library for Node.js that requires unsupported Node.js APIs. Fails with 'No such module "node:os"' - the os module (for hostname, platform info) is not available in Workers even with nodejs_compat. Bunyan relies on Node.js-specific APIs like os.hostname(), process.pid, and filesystem streams for logging.

πŸ’‘ Alternative: pino

Error: No such module "node:os".

bytes

βœ… Works
v3.1.2 91,190,838 weekly downloads utility

Convert byte values to/from human-readable strings (e.g., "1MB" ↔ 1048576).

View Example
import bytes from 'bytes';

// Usage:
const parsed = bytes('1MB');
const formatted = bytes(1048576);
return { success: parsed === 1048576 && formatted === '1MB', result: { parsed, formatted } };

camelcase

βœ… Works
v9.0.0 118,058,431 weekly downloads string

Convert strings to camelCase format.

View Example
import camelCase from 'camelcase';

// Usage:
const result1 = camelCase('foo-bar');
const result2 = camelCase('foo_bar');
const result3 = camelCase('foo bar');
return { success: result1 === 'fooBar' && result2 === 'fooBar' && result3 === 'fooBar', result: { result1, result2, result3 } };

cbor

βœ… Works
v10.0.11 911,279 weekly downloads encoding

CBOR (Concise Binary Object Representation) encoding/decoding.

πŸ’‘ Alternative: @msgpack/msgpack (MessagePack is similar binary format)

View Example
import { encode, decode } from 'cbor';

// Usage:
const data = { name: 'test', values: [1, 2, 3] };
const encoded = encode(data);
const decoded = decode(encoded);
return { success: decoded.name === 'test', result: { decoded, encodedLength: encoded.length } };

chai

βœ… Works
v6.2.2 30,524,866 weekly downloads testing

BDD/TDD assertion library. Works on Workers but primarily for test frameworks.

View Example
import { expect } from 'chai';

// Usage:
expect(2 + 2).to.equal(4);
expect('hello').to.be.a('string');
expect([1, 2, 3]).to.have.lengthOf(3);
return { success: true, result: 'All assertions passed' };

chance

βœ… Works
v1.1.13 1,839,527 weekly downloads utility

Random data generator for testing, mocking APIs, and development. Generates names, emails, addresses, GUIDs, IPs, colors, sentences, and more. Supports seeding for reproducible results.

View Example
import Chance from 'chance';

export default {
  async fetch(request) {
    const chance = new Chance();
    // Seed for reproducible results
    const seeded = new Chance(12345);
    
    return Response.json({
      person: {
        name: chance.name(),
        email: chance.email(),
        phone: chance.phone(),
        address: chance.address(),
        city: chance.city()
      },
      misc: {
        guid: chance.guid(),
        ip: chance.ip(),
        url: chance.url(),
        color: chance.color({ format: 'hex' })
      },
      // Seeded gives same result every time
      seededName: seeded.name()
    });
  }
};

change-case

βœ… Works
v5.4.4 13,556,150 weekly downloads string
View Example
import { camelCase, snakeCase } from 'change-case';

// Usage:
const camel = camelCase('hello world');
const snake = snakeCase('helloWorld');
return { success: true, result: { camel, snake } };

cheerio

βœ… Works
v1.1.2 12,843,962 weekly downloads parsing

jQuery-like HTML parsing and manipulation. Perfect for web scraping, HTML transformation, and extracting data from webpages on Workers. Supports full CSS selectors.

View Example
import * as cheerio from 'cheerio';

export default {
  async fetch(request) {
    // Fetch and parse a webpage
    const response = await fetch('https://example.com');
    const html = await response.text();
    const $ = cheerio.load(html);
    
    // Extract data with jQuery-like selectors
    const title = $('title').text();
    const h1 = $('h1').text();
    const links = $('a').map((i, el) => $(el).attr('href')).get();
    
    // Manipulate HTML
    $('h1').addClass('scraped').text('Modified');
    
    return Response.json({ title, h1, links });
  }
};

chroma-js

βœ… Works
v3.2.0 1,473,645 weekly downloads utility

Color manipulation library for parsing (hex, rgb, hsl, lab), converting between formats, generating scales/gradients, mixing colors, and checking WCAG contrast ratios for accessibility.

View Example
import chroma from 'chroma-js';

export default {
  async fetch(request) {
    // Parse and manipulate colors
    const color = chroma('#3498db');
    
    return Response.json({
      original: color.hex(),
      darken: color.darken().hex(),
      brighten: color.brighten().hex(),
      rgb: color.rgb(),
      hsl: color.hsl(),
      luminance: color.luminance(),
      // Generate color scales
      gradient: chroma.scale(['#fafa6e', '#2A4858']).colors(5),
      // Color mixing
      mix: chroma.mix('red', 'blue', 0.5).hex(),
      // WCAG contrast check
      contrast: chroma.contrast('white', '#3498db')
    });
  }
};

class-validator

⚠️ Works (with notes)
v0.14.3 5,479,996 weekly downloads validation

Decorator-based validation. Decorators require TypeScript with experimentalDecorators and special bundler config. Consider using zod instead for simpler setup.

πŸ’‘ Alternative: zod

View Example
import { ValidationError } from 'class-validator';

// Usage: Decorators need TypeScript experimentalDecorators
const err = new ValidationError();
err.property = 'email';
err.constraints = { isEmail: 'must be valid email' };
return { success: true, result: { note: 'Use zod for Workers - decorators need special bundler config' } };

classnames

βœ… Works
v2.5.1 17,170,099 weekly downloads utility

Conditionally join CSS class names together. Useful for dynamic styling.

View Example
import classNames from 'classnames';

// Usage:
const classes = classNames('btn', { active: true, disabled: false }, 'primary');
return { success: classes === 'btn active primary', result: classes };

cli-table

βœ… Works
v0.3.11 2,921,668 weekly downloads utility

CLI table formatting. Limited usefulness in Workers but works.

View Example
import Table from 'cli-table';

// Usage:
const table = new Table({ head: ['Name', 'Age'] });
table.push(['John', '30'], ['Jane', '25']);
const str = table.toString();
return { success: str.includes('John') && str.includes('30'), result: str.substring(0, 100) };

clone

βœ… Works
v2.1.2 43,010,374 weekly downloads utility

Deep clone objects including dates, functions, and nested structures. Works on Workers. Alternative: structuredClone() for simpler cases.

πŸ’‘ Alternative: built-in: structuredClone

View Example
import clone from 'clone';

const original = { a: 1, b: { c: 2 } };
const cloned = clone(original);
cloned.b.c = 999;
// original.b.c is still 2
return { success: original.b.c === 2, cloned };

co

βœ… Works
v4.6.0 28,282,961 weekly downloads utility

Generator-based async control flow. Supports sequential operations, parallel arrays/objects. Modern async/await is preferred for new code, but co still works for legacy codebases.

View Example
import co from 'co';

export default {
  async fetch(request) {
    // Generator-based control flow
    const result = await co(function* () {
      // Sequential async operations
      const response = yield fetch('https://httpbin.org/json');
      const data = yield response.json();
      
      // Parallel with arrays
      const [a, b, c] = yield [
        Promise.resolve(1),
        Promise.resolve(2),
        Promise.resolve(3)
      ];
      
      return { title: data.slideshow.title, sum: a + b + c };
    });
    
    return Response.json(result);
  }
};

color

βœ… Works
v5.0.3 30,505,726 weekly downloads utility

Color manipulation and conversion library. Works well in Workers.

View Example
import Color from 'color';

// Usage:
const color = Color('rgb(255, 0, 0)');
const hex = color.hex();
const lightened = color.lighten(0.5).hex();
return { success: hex === '#FF0000', result: { hex, lightened } };

common-tags

βœ… Works
v1.8.2 14,306,939 weekly downloads string

ES2015 template literal tag functions for string manipulation (stripIndent, oneLine, html, etc.).

View Example
import { stripIndent, oneLine, html } from 'common-tags';

// Usage:
const multiline = stripIndent`
      Hello
        World
          !
    `;
const single = oneLine`
      This will be
      on one line
    `;
const markup = html`<div>Hello</div>`;
return { 
  success: multiline === 'Hello\n  World\n    !' && single.includes('This will be on one line'), 
  result: { multiline, single, markup } 
};

component-emitter

βœ… Works
v2.0.0 19,928,757 weekly downloads async

Simple event emitter for creating event-based APIs with on/off/emit methods.

View Example
import Emitter from 'component-emitter';

// Usage:
const emitter = new Emitter();
let result = null;
emitter.on('test', (data) => { result = data; });
emitter.emit('test', 'hello');
return { success: result === 'hello', result };

compression

βœ… Works
v1.8.1 38,194,791 weekly downloads utility

Express middleware for gzip/deflate compression. Works with Express via httpServerHandler.

πŸ’‘ Alternative: CompressionStream (built-in Web API) or Hono's compress() middleware

View Example
import { httpServerHandler } from 'cloudflare:node';
import express from 'express';
import compression from 'compression';

const app = express();
app.use(compression());

app.get('/test', (req, res) => {
  res.json({ data: 'x'.repeat(1000) });
});

app.listen(3000);
export default httpServerHandler({ port: 3000 });

concat-stream

βœ… Works
v2.0.0 23,700,755 weekly downloads utility
View Example
import concat from 'concat-stream';

// Usage:
const { Writable } = await import('stream');
const stream = concat((data) => { 
  return { success: data.toString() === 'hello', result: data.toString() };
});
stream.write('hello');
stream.end();
return { success: true, result: 'stream created' };

connect

βœ… Works
v3.7.0 8,833,651 weekly downloads server-framework

Extensible HTTP server framework (predecessor to Express). Works with httpServerHandler.

πŸ’‘ Alternative: Hono or itty-router

Error: Unexpected token ':'

View Example
import { httpServerHandler } from 'cloudflare:node';
import connect from 'connect';

const app = connect();
app.use((req, res) => {
  res.end('Hello from Connect!');
});

app.listen(3000);
export default httpServerHandler({ port: 3000 });

connect-flash

βœ… Works
v0.1.1 140,732 weekly downloads utility

Flash message middleware for Express. Works with express-session via httpServerHandler.

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

View Example
import { httpServerHandler } from 'cloudflare:node';
import express from 'express';
import session from 'express-session';
import flash from 'connect-flash';

const app = express();
app.use(session({ secret: 'secret', resave: false, saveUninitialized: true }));
app.use(flash());

app.get('/set', (req, res) => { req.flash('info', 'Hello!'); res.json({ set: true }); });
app.get('/get', (req, res) => res.json({ messages: req.flash('info') }));

app.listen(3000);
export default httpServerHandler({ port: 3000 });
vunknown 13,133,893 weekly downloads framework

Middleware to proxy requests through index.html for SPA routing. Works with Express via httpServerHandler.

View Example
import { httpServerHandler } from 'cloudflare:node';
import express from 'express';
import history from 'connect-history-api-fallback';

const app = express();
app.use(history({ rewrites: [{ from: /^\/api\/.*$/, to: ctx => ctx.parsedUrl.pathname }] }));

app.get('/index.html', (req, res) => res.send('<html>SPA</html>'));
app.get('/api/test', (req, res) => res.json({ api: true }));

app.listen(3000);
export default httpServerHandler({ port: 3000 });

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 };
v2.0.0 93,563,801 weekly downloads utility

Converts source maps between different formats (JSON, base64, inline comments).

View Example
import { fromObject, fromJSON } from 'convert-source-map';

// Usage:
const map = { version: 3, sources: ['foo.js'], mappings: 'AAAA' };
const converter = fromObject(map);
const json = converter.toJSON();
const parsed = fromJSON(json);
return { success: parsed.toObject().version === 3, result: parsed.toObject() };

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

cookie-parser

βœ… Works
vunknown 5,049,256 weekly downloads framework

Express middleware for parsing cookies. Works with Express via httpServerHandler.

View Example
import { httpServerHandler } from 'cloudflare:node';
import express from 'express';
import cookieParser from 'cookie-parser';

const app = express();
app.use(cookieParser('secret'));

app.get('/test', (req, res) => {
  res.cookie('test', 'value', { signed: true });
  res.json({ cookies: req.signedCookies });
});

app.listen(3000);
export default httpServerHandler({ port: 3000 });

cookie-signature

βœ… Works
v1.2.2 53,307,800 weekly downloads crypto
View Example
import { sign, unsign } from 'cookie-signature';

// Usage:
const val = sign('hello', 'secret');
const result = unsign(val, 'secret');
return { success: result === 'hello', 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 });

crc

βœ… Works
v4.3.2 2,407,108 weekly downloads crypto

CRC (Cyclic Redundancy Check) checksums - supports CRC1, CRC8, CRC16, CRC24, CRC32

View Example
import { crc32 } from 'crc';

// Usage:
const checksum = crc32('hello world');
return { success: typeof checksum === 'number' && checksum === 0x0d4a1185, result: '0x' + checksum.toString(16) };

create-hash

πŸ”„ Alternative Available
v1.2.0 10,344,994 weekly downloads crypto

create-hash is a Node.js crypto.createHash polyfill (part of crypto-browserify) that provides hash digest functions (md5, sha1, sha256, sha512, etc.). Fails with 'Cannot read properties of undefined (reading 'slice')' due to Buffer implementation incompatibilities. Workers has the built-in Web Crypto API (crypto.subtle.digest) which is the modern standard for hashing and provides better performance.

πŸ’‘ Alternative: Web Crypto API (crypto.subtle.digest) - built-in

cron

πŸ”„ Alternative Available
v4.4.0 3,623,869 weekly downloads utility

Node.js cron job scheduler for running scheduled tasks (e.g., CronJob('0 0 * * *', callback)). Requires child_process for spawning tasks. Workers has built-in Scheduled Events (Cron Triggers) for scheduled tasks - use scheduled handler: export default { scheduled(event, env, ctx) { ... } }

πŸ’‘ Alternative: Cloudflare Workers Scheduled Events (Cron Triggers) - built-in

Error: No such module "node:child_process".

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

crypto-js

βœ… Works
v4.2.0 10,695,783 weekly downloads crypto

Crypto library for hashing (SHA256, MD5) and encryption (AES). Works on Workers. Consider Web Crypto API for better performance.

πŸ’‘ Alternative: built-in: crypto

View Example
import CryptoJS from 'crypto-js';

// Hash a string
const hash = CryptoJS.SHA256('hello world').toString();

// Encrypt/decrypt
const encrypted = CryptoJS.AES.encrypt('secret', 'password').toString();
const decrypted = CryptoJS.AES.decrypt(encrypted, 'password').toString(CryptoJS.enc.Utf8);

return { success: true, hash, decrypted };

csv

βœ… Works
v6.4.1 1,388,451 weekly downloads parsing

Full-featured CSV parsing and generation. Supports headers, custom delimiters (TSV), quoted values, escaped characters, and both sync and streaming APIs.

View Example
import { parse, stringify } from 'csv/sync';

export default {
  async fetch(request) {
    // Parse CSV with headers as column names
    const csvData = 'name,age,city\nAlice,30,NYC\nBob,25,LA';
    const records = parse(csvData, { columns: true, skip_empty_lines: true });
    
    // Generate CSV from objects
    const data = [{ id: 1, product: 'Widget', price: 9.99 }];
    const csv = stringify(data, { header: true });
    
    // TSV support with custom delimiter
    const tsv = 'name\tvalue\nfoo\t100';
    const tsvRecords = parse(tsv, { columns: true, delimiter: '\t' });
    
    return Response.json({ records, csv, tsvRecords });
  }
};

cuid

βœ… Works
v3.0.0 537,104 weekly downloads id-generation

Collision-resistant ID generator. Creates sortable, URL-safe IDs. Includes cuid.slug() for shorter IDs and validation functions. Works on Workers with nodejs_compat.

View Example
import cuid from 'cuid';

export default {
  async fetch(request) {
    // Generate collision-resistant IDs
    const id = cuid();
    
    // Shorter slug version for URLs
    const slug = cuid.slug();
    
    // Validate IDs
    const isValid = cuid.isCuid(id);
    const isSlug = cuid.isSlug(slug);
    
    // Generate multiple unique IDs
    const ids = Array.from({ length: 5 }, () => cuid());
    
    return Response.json({ id, slug, isValid, isSlug, ids });
  }
};

d3-array

βœ… Works
v3.2.4 23,436,064 weekly downloads utility

D3 array manipulation library with statistical functions (min, max, mean, median), array transformations (group, bin, bisect), and data operations.

View Example
import { min, max, mean, median, extent, group } from 'd3-array';

// Usage:
const data = [1, 5, 2, 8, 3];
const minVal = min(data);
const maxVal = max(data);
const meanVal = mean(data);
const medianVal = median(data);
const extentVal = extent(data);
const grouped = group([{key: 'a', val: 1}, {key: 'b', val: 2}, {key: 'a', val: 3}], d => d.key);
return { success: minVal === 1 && maxVal === 8 && meanVal === 3.8 && medianVal === 3, result: { minVal, maxVal, meanVal, medianVal, extentVal, grouped: grouped.size } };

d3-scale

βœ… Works
v4.0.2 16,890,907 weekly downloads utility

D3 scales for mapping data values to visual ranges. Includes linear, logarithmic, power, time, and categorical scales for data visualization.

View Example
import { scaleLinear, scaleLog, scalePow, scaleTime } from 'd3-scale';

// Usage:
const linear = scaleLinear().domain([0, 10]).range([0, 100]);
const log = scaleLog().domain([1, 10]).range([0, 100]);
const pow = scalePow().exponent(2).domain([0, 10]).range([0, 100]);
const time = scaleTime().domain([new Date(2020, 0, 1), new Date(2021, 0, 1)]).range([0, 100]);
const linearVal = linear(5);
const logVal = log(5);
const powVal = pow(5);
const timeVal = time(new Date(2020, 6, 1));
return { success: linearVal === 50 && logVal > 0 && powVal === 25 && timeVal > 0, result: { linearVal, logVal, powVal, timeVal } };

d3-shape

βœ… Works
v3.2.0 20,312,077 weekly downloads utility

D3 shape generators for SVG path data. Provides line(), area(), pie(), arc(), and more for creating data-driven shapes and charts.

View Example
import { line, area, pie, arc } from 'd3-shape';

// Usage:
const lineGenerator = line().x((d, i) => i * 10).y(d => d);
const linePath = lineGenerator([10, 20, 30, 20, 10]);
const areaGenerator = area().x((d, i) => i * 10).y0(0).y1(d => d);
const areaPath = areaGenerator([10, 20, 30, 20, 10]);
const pieGenerator = pie();
const pieData = pieGenerator([1, 2, 3]);
const arcGenerator = arc().innerRadius(0).outerRadius(100);
const arcPath = arcGenerator(pieData[0]);
return { success: typeof linePath === 'string' && typeof areaPath === 'string' && pieData.length === 3 && typeof arcPath === 'string', result: { linePath: linePath.substring(0, 20), pieAngles: pieData.map(d => [d.startAngle, d.endAngle]) } };

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

debounce

βœ… Works
v3.0.0 11,611,829 weekly downloads async

Delays function calls until a set time elapses after the last invocation.

View Example
import debounce from 'debounce';

// Usage:
let callCount = 0;
const debouncedFn = debounce(() => { callCount++; }, 100);
debouncedFn();
debouncedFn();
debouncedFn();
// Wait for debounce delay
await new Promise(resolve => setTimeout(resolve, 150));
return { success: callCount === 1, result: callCount };

debug

βœ… Works
v4.4.3 392,562,383 weekly downloads utility

Lightweight debugging utility with namespace-based logging. Works in Workers - debug output appears in console/logs.

View Example
import debug from 'debug';

// Create namespaced loggers
const logApp = debug('app:main');
const logHttp = debug('app:http');

// Enable namespaces
debug.enable('app:*');

export default {
  async fetch(request) {
    const url = new URL(request.url);
    logApp('Request: %s %s', request.method, url.pathname);
    logHttp('Headers: %O', Object.fromEntries(request.headers));
    
    return Response.json({ debugEnabled: debug.enabled('app:main') });
  }
};

decamelize

βœ… Works
v6.0.1 38,139,427 weekly downloads string

Converts camelCase strings to lowercase with custom separator (default underscore).

View Example
import decamelize from 'decamelize';

// Usage:
const result = decamelize('unicornRainbow');
const custom = decamelize('unicornRainbow', { separator: '-' });
return { success: result === 'unicorn_rainbow' && custom === 'unicorn-rainbow', result: { result, custom } };

decimal.js

βœ… Works
v10.6.0 30,848,538 weekly downloads utility

Arbitrary-precision decimal arithmetic

View Example
import Decimal from 'decimal.js';

// Usage:
const x = new Decimal(0.1);
const y = new Decimal(0.2);
const result = x.plus(y).toString();
return { success: result === '0.3', result };

deep-diff

βœ… Works
v1.0.2 2,120,194 weekly downloads utility

Calculate deep differences between objects. Captures changes (added, deleted, edited, array changes) and can apply/revert changes.

View Example
import { diff, applyChange } from 'deep-diff';

// Usage:
const lhs = { name: 'Alice', age: 30, city: 'NYC' };
const rhs = { name: 'Alice', age: 31, city: 'LA' };
const differences = diff(lhs, rhs);
const hasChanges = differences && differences.length === 2;
const ageChanged = differences.some(d => d.path[0] === 'age' && d.lhs === 30 && d.rhs === 31);
const cityChanged = differences.some(d => d.path[0] === 'city' && d.lhs === 'NYC' && d.rhs === 'LA');
return { success: hasChanges && ageChanged && cityChanged, result: differences };

deep-equal

βœ… Works
v2.2.3 20,172,521 weekly downloads utility

Deep equality comparison for objects

View Example
import deepEqual from 'deep-equal';

// Usage:
const result1 = deepEqual({ a: 1, b: { c: 2 } }, { a: 1, b: { c: 2 } });
const result2 = deepEqual({ a: 1 }, { a: 2 });
return { success: result1 && !result2, result: { result1, result2 } };

deep-extend

βœ… Works
v0.6.0 40,313,151 weekly downloads utility

Recursively extend objects

View Example
import deepExtend from 'deep-extend';

// Usage:
const result = deepExtend({ a: 1, b: { c: 2 } }, { b: { d: 3 } });
return { success: result.a === 1 && result.b.c === 2 && result.b.d === 3, result };

deepmerge

βœ… Works
v4.3.1 47,726,009 weekly downloads utility

Deep merge of objects

View Example
import deepmerge from 'deepmerge';

// Usage:
const result = deepmerge({ a: 1, b: { c: 2 } }, { b: { d: 3 } });
return { success: result.a === 1 && result.b.c === 2 && result.b.d === 3, result };

depd

βœ… Works
v2.0.0 69,104,358 weekly downloads utility

Deprecation warning utility for Node.js modules. Works in Workers for issuing console warnings about deprecated API usage.

View Example
import depd from 'depd';

const deprecate = depd('my-module');

function oldFunction() {
  deprecate('oldFunction() is deprecated');
  return 'result';
}

export default {
  async fetch(request) {
    const result = oldFunction();
    return Response.json({ result, message: 'Check console for deprecation warning' });
  }
};

destroy

βœ… Works
v1.2.0 37,606,886 weekly downloads utility

Destroy a stream safely, handling different stream types.

View Example
import destroy from 'destroy';
import { Readable } from 'node:stream';

// Usage:
const stream = new Readable({ read() {} });
destroy(stream);
return { success: stream.destroyed, result: { destroyed: stream.destroyed } };

devalue

βœ… Works
v5.6.1 3,398,301 weekly downloads utility

Serialize JavaScript values (including Date, RegExp, Map, Set)

View Example
import { stringify, parse } from 'devalue';

// Usage:
const obj = { a: 1, b: new Date('2026-01-10'), c: /test/ };
const str = stringify(obj);
const result = parse(str);
return { success: result.a === 1 && result.b instanceof Date, result };

diff

βœ… Works
v8.0.2 60,704,392 weekly downloads utility

Text diff implementation (characters, words, lines, JSON)

View Example
import * as diff from 'diff';

// Usage:
const result = diff.diffChars('hello', 'hallo');
return { success: result.length > 0 && result.some(p => p.added || p.removed), result };

dinero.js

βœ… Works
v1.9.1 252,901 weekly downloads utility

Money/currency handling with precision

View Example
import Dinero from 'dinero.js';

// Usage:
const price = Dinero({ amount: 500, currency: 'USD' });
const total = price.add(Dinero({ amount: 200, currency: 'USD' }));
return { success: total.getAmount() === 700, result: total.toFormat('$0,0.00') };

discord.js

πŸ”„ Alternative Available
v14.25.1 327,396 weekly downloads utility

discord.js is a Discord bot library that requires persistent WebSocket connections to Discord's Gateway API for real-time events (listening to messages, presence updates, voice state changes, etc.). Designed for long-running Node.js bot applications that maintain always-on Gateway connections. Workers is a stateless serverless environment without support for persistent WebSocket connections or long-running processes. The main discord.js package uses @discordjs/ws for Gateway WebSocket management which is incompatible with Workers' request/response lifecycle. Note: The discord.js website shows 'Powered by Cloudflare Workers' because their documentation site is hosted on Workers, not because the bot library works on Workers. For Discord interactions on Workers, use @discordjs/rest (REST API only) or @discordjs/core (thin wrapper for REST + webhook-based interactions). These packages support slash commands, webhooks, and REST API calls without requiring Gateway connections.

πŸ’‘ Alternative: @discordjs/rest or @discordjs/core for REST-only Discord interactions (slash commands, webhooks)

dompurify

πŸ”„ Alternative Available
v3.3.1 16,647,201 weekly downloads security

DOMPurify requires a real DOM (window/document) which Workers doesn't have. isomorphic-dompurify also doesn't work (isSupported: false). Use sanitize-html instead - it's a pure string-based HTML sanitizer that works perfectly on Workers without DOM dependencies.

πŸ’‘ Alternative: sanitize-html

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

elliptic

πŸ”„ Alternative Available
v6.6.1 10,482,180 weekly downloads crypto

Pure JavaScript elliptic curve cryptography library for ECDSA, EdDSA, and ECDH operations. Supports curves: secp256k1, p192, p224, p256, p384, p521, curve25519, ed25519. Fails with 'Unexpected token ":"' parse error when bundled for Workers - likely due to code incompatible with Workers runtime. Workers has the built-in Web Crypto API (crypto.subtle) which provides native elliptic curve cryptography (ECDSA with P-256/P-384/P-521, ECDH) with better performance and security than pure JavaScript implementations.

πŸ’‘ Alternative: Web Crypto API (crypto.subtle.sign/verify with ECDSA, crypto.subtle.deriveKey/deriveBits with ECDH) - built-in

Error: Unexpected token ':'

email-validator

βœ… Works
v2.0.4 1,119,780 weekly downloads validation

Simple email validation

View Example
import validator from 'email-validator';

// Usage:
const valid = validator.validate('test@example.com');
const invalid = validator.validate('notanemail');
return { success: valid && !invalid, result: { valid, invalid } };

encoding

βœ… Works
v0.1.13 19,340,831 weekly downloads encoding

Character encoding conversion

View Example
import { convert } from 'encoding';

// Usage:
const result = convert('hello', 'UTF-8');
return { success: result.toString() === 'hello', result: result.toString() };

es6-promise

βœ… Works
v4.2.8 12,246,087 weekly downloads utility

ES6 Promise polyfill (mostly unnecessary in Workers)

View Example
import { Promise } from 'es6-promise';

// Usage:
const p = new Promise((resolve) => resolve('ok'));
const result = await p;
return { success: result === 'ok', result };

es6-promisify

βœ… Works
v7.0.0 3,863,840 weekly downloads async

Converts callback-based functions to ES6 Promises.

View Example
import { promisify } from 'es6-promisify';

// Usage:
// Create a callback-based function
const callbackFn = (a, b, callback) => {
  setTimeout(() => callback(null, a + b), 10);
};
// Convert to promise-based
const promiseFn = promisify(callbackFn);
const result = await promiseFn(2, 3);
return { success: result === 5, result };

escape-html

βœ… Works
v1.0.3 46,544,158 weekly downloads string
View Example
import escapeHtml from 'escape-html';

// Usage:
const escaped = escapeHtml('<script>alert("xss")</script>');
return { success: escaped.includes('&lt;'), result: escaped };
v5.0.0 172,751,588 weekly downloads utility

Escape special regex characters

View Example
import escapeStringRegexp from 'escape-string-regexp';

// Usage:
const result = escapeStringRegexp('foo.bar*baz');
return { success: result === 'foo\\.bar\\*baz', result };

esprima

βœ… Works
v4.0.1 59,767,399 weekly downloads utility

JavaScript parser (ECMAScript parser)

View Example
import { parseScript } from 'esprima';

// Usage:
const ast = parseScript('const x = 42;');
return { success: ast.type === 'Program', result: ast.type };

etag

βœ… Works
v1.8.1 44,184,549 weekly downloads utility

Generate HTTP ETags for caching. Create strong/weak ETags from content.

View Example
import etag from 'etag';

// Usage:
const body = 'Hello World';
const tag = etag(body);
return { success: tag.startsWith('"') || tag.startsWith('W/'), result: { etag: tag } };

ethereumjs-tx

πŸ”„ Alternative Available
v2.1.2 121,914 weekly downloads crypto

DEPRECATED package - last published 6 years ago (2018). ethereumjs-tx is the legacy Ethereum transaction library for creating, signing, and serializing Ethereum transactions. Used for constructing raw Ethereum transactions with Transaction class that handles nonce, gasPrice, gasLimit, to, value, data fields. Supports EIP-155 replay protection, chain/hardfork configuration (mainnet, ropsten, custom networks), transaction signing with private keys via sign() method, and serialization for broadcast to Ethereum nodes. Part of the EthereumJS ecosystem (ethereumjs-util, ethereumjs-common, ethereumjs-vm). Official deprecation message: 'New package name format for new versions: @ethereumjs/tx. Please update.' The package has been superseded by @ethereumjs/tx which has modern features, active maintenance, and improved TypeScript support. Similar Ethereum transaction libraries include ethers.js (more complete, recommended), web3.js (older alternative), viem (modern TypeScript alternative).

πŸ’‘ Alternative: @ethereumjs/tx (official successor) - may work with Workers, needs testing

ethereumjs-util

πŸ”„ Alternative Available
v7.1.5 1,799,163 weekly downloads crypto

DEPRECATED - old package (last published 2022). Official successor is @ethereumjs/util (v10.x, actively maintained, published 2025-11). The old package provides Ethereum utility functions: account/address operations (creation, validation, conversion, checksums), byte manipulation helpers, hash functions (Keccak-256), signature operations (signing, validation, recovery), constants (KECCAK256_NULL_S, etc.), and re-exports BN.js and rlp. Modern @ethereumjs/util has better TypeScript support, improved APIs, and active maintenance with latest Ethereum specs. Part of EthereumJS ecosystem (ethereumjs-tx β†’ @ethereumjs/tx, ethereumjs-common β†’ @ethereumjs/common, etc.). Dependencies include create-hash, ethereum-cryptography, bn.js, rlp - all pure JS crypto. Similar Ethereum utilities include ethers.js utils, web3.js utils, viem utils.

πŸ’‘ Alternative: @ethereumjs/util (v10.x, official successor) - may work with Workers, needs testing

event-stream

βœ… Works
v4.0.1 4,549,373 weekly downloads utility

Stream utilities and helpers

View Example
import es from 'event-stream';

// Usage:
const results = [];
const stream = es.through(function(data) { results.push(data); this.emit('data', data); });
stream.write('test');
return { success: results[0] === 'test', result: results };

eventemitter2

βœ… Works
v6.4.9 12,922,827 weekly downloads utility

Enhanced EventEmitter with wildcards and namespaces

View Example
import { EventEmitter2 } from 'eventemitter2';

// Usage:
const emitter = new EventEmitter2();
let called = false;
emitter.on('test', () => { called = true; });
emitter.emit('test');
return { success: called, result: { called } };

eventemitter3

βœ… Works
v5.0.1 57,574,362 weekly downloads utility

Fast EventEmitter implementation

View Example
import EventEmitter from 'eventemitter3';

// Usage:
const emitter = new EventEmitter();
let value = '';
emitter.on('event', (msg) => { value = msg; });
emitter.emit('event', 'hello');
return { success: value === 'hello', result: { value } };

events

βœ… Works
v3.3.0 46,481,803 weekly downloads utility

Node.js EventEmitter - available in Workers

View Example
import { EventEmitter } from 'events';

// Usage:
const ee = new EventEmitter();
let count = 0;
ee.on('test', () => { count++; });
ee.emit('test');
return { success: count === 1, result: { count } };

express

βœ… Works
v5.2.1 54,070,149 weekly downloads server-framework

Node.js web framework. Works on Workers with httpServerHandler from cloudflare:node. Requires nodejs_compat flag.

πŸ’‘ Alternative: Hono (most Express-like, fastest), itty-router (tiny, simple), Toucan (Sentry-like routing), or workers-router (official Cloudflare routing helper)

Error: Unexpected strict mode reserved word

View Example
import { httpServerHandler } from 'cloudflare:node';
import express from 'express';

const app = express();
app.use(express.json());

app.get('/',(req, res) => res.json({ message: 'Express on Workers!' }));
app.post('/echo', (req, res) => res.json({ received: req.body }));

app.listen(3000);
export default httpServerHandler({ port: 3000 });

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

extend

βœ… Works
v3.0.2 39,312,400 weekly downloads utility

Object extension utility

View Example
import extend from 'extend';

// Usage:
const result = extend({ a: 1 }, { b: 2 }, { c: 3 });
return { success: result.a === 1 && result.b === 2 && result.c === 3, result };

extend-shallow

βœ… Works
v3.0.2 48,872,608 weekly downloads utility

Shallow object extension utility. Like Object.assign() but with more flexible API for merging multiple objects.

View Example
import extend from 'extend-shallow';

// Usage:
const obj1 = { a: 1, b: 2 };
const obj2 = { b: 3, c: 4 };
const obj3 = { c: 5, d: 6 };
const result = extend(obj1, obj2, obj3);
const success = result.a === 1 && result.b === 3 && result.c === 5 && result.d === 6;
return { success, result };

faker

πŸ”„ Alternative Available
v6.6.6 1,874,147 weekly downloads dev-tool

DEPRECATED package (last published 2022) - the original faker.js library by Marak for generating fake data (names, addresses, emails, phone numbers, lorem ipsum, dates, etc.). Package was abandoned in January 2022 after the maintainer deleted the repository in protest. The community immediately forked the project to @faker-js/faker which is now the official maintained successor with active development, bug fixes, new locales, TypeScript improvements, and better tree-shaking. The old 'faker' package (v6.6.6) still works for basic fake data generation but receives no updates, security patches, or new features. Used extensively in: test data generation (seeding databases, populating fixtures), development/demos (mock data for UI development), API mocking (generating realistic API responses), and data anonymization. @faker-js/faker has identical API for easy migration (faker.name.findName(), faker.internet.email(), faker.address.city(), etc.), better TypeScript support with improved type definitions, more locales (70+ languages), active community maintenance with regular updates, and modern bundler optimization. Similar fake data generators include chance.js (alternative API), casual (simpler alternative), json-schema-faker (generates from JSON schemas).

πŸ’‘ Alternative: @faker-js/faker (official community-maintained fork) - may work with Workers, needs testing

fast-deep-equal

βœ… Works
v3.1.3 93,168,733 weekly downloads utility

Fast deep equality comparison for objects and arrays

View Example
import equal from 'fast-deep-equal';

// Usage:
const a = { x: 1, y: { z: 2 } };
const b = { x: 1, y: { z: 2 } };
const c = { x: 1, y: { z: 3 } };
const result1 = equal(a, b);
const result2 = equal(a, c);
return { success: result1 === true && result2 === false, result: { equal: result1, notEqual: result2 } };

fast-xml-parser

βœ… Works
v5.3.3 46,575,790 weekly downloads parsing

Fast XML parser, builder, and validator. Supports attributes, CDATA, namespaces, and various XML formats (RSS, SOAP, etc.). No DOM required - pure string parsing.

View Example
import { XMLParser, XMLBuilder, XMLValidator } from 'fast-xml-parser';

export default {
  async fetch(request) {
    // Parse XML to JSON
    const parser = new XMLParser({ ignoreAttributes: false, attributeNamePrefix: '@_' });
    const xml = '<catalog><book id="1"><title>JS Guide</title></book></catalog>';
    const parsed = parser.parse(xml);
    
    // Build XML from JSON
    const builder = new XMLBuilder({ ignoreAttributes: false, attributeNamePrefix: '@_' });
    const built = builder.build({ root: { item: [{ '@_id': '1', name: 'Item' }] } });
    
    // Validate XML
    const isValid = XMLValidator.validate(xml);
    
    return Response.json({ parsed, built, isValid });
  }
};

fflate

βœ… Works
v0.8.2 20,528,356 weekly downloads compression

Fast pure-JS compression library. Supports GZIP, DEFLATE, ZLIB, and ZIP. Both creation and extraction work (unlike adm-zip). Use sync versions (gzipSync, zipSync) in Workers.

View Example
import { gzipSync, gunzipSync, zipSync, unzipSync, strToU8, strFromU8 } from 'fflate';

export default {
  async fetch(request) {
    // GZIP compression
    const text = 'Hello '.repeat(100);
    const gzipped = gzipSync(strToU8(text));
    const ungzipped = strFromU8(gunzipSync(gzipped));
    
    // Create ZIP archive
    const archive = zipSync({
      'hello.txt': strToU8('Hello World'),
      'data.json': strToU8(JSON.stringify({ test: true }))
    });
    
    // Extract ZIP
    const extracted = unzipSync(archive);
    
    return Response.json({
      gzipRatio: (gzipped.length / text.length * 100).toFixed(1) + '%',
      zipFiles: Object.keys(extracted)
    });
  }
};

figlet

βœ… Works
v1.9.4 1,466,513 weekly downloads utility

ASCII art text generator. Must preload fonts using importable-fonts - async font loading does not work in Workers.

View Example
import figlet from 'figlet';
import standard from 'figlet/importable-fonts/Standard.js';

// Usage: Must preload fonts
figlet.parseFont('Standard', standard);
const ascii = figlet.textSync('Hi!', { font: 'Standard' });
return { success: ascii.length > 0, result: { ascii } };

file-type

βœ… Works
v21.3.0 28,152,100 weekly downloads utility

Detects file types from file signatures (magic bytes). Works with Uint8Array buffers. Useful for validating uploads, detecting MIME types.

View Example
import { fileTypeFromBuffer } from 'file-type';

// Usage:
// PNG magic bytes: 89 50 4E 47 0D 0A 1A 0A (with some extra bytes for the tokenizer)
const pngBytes = new Uint8Array([
  0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A,
  0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52,
  0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
  0x08, 0x06, 0x00, 0x00, 0x00, 0x1F, 0x15, 0xC4
]);
const result = await fileTypeFromBuffer(pngBytes);
return { success: result?.ext === 'png' && result?.mime === 'image/png', result };

filesize

βœ… Works
v11.0.13 11,737,397 weekly downloads utility

Human-readable file sizes. Use named import: import { filesize } from filesize

View Example
import { filesize } from 'filesize';

filesize(1024); // '1.02 kB'

finalhandler

βœ… Works
v2.1.1 61,042,944 weekly downloads server-framework

Express/Connect final handler for ending middleware chains. Works with httpServerHandler - correctly handles 404s and errors.

πŸ’‘ Alternative: Use Hono or itty-router for error handling

View Example
import { httpServerHandler } from 'cloudflare:node';
import { createServer } from 'node:http';
import finalhandler from 'finalhandler';

const server = createServer((req, res) => {
  const done = finalhandler(req, res);
  
  if (req.url === '/') {
    res.writeHead(200, { 'Content-Type': 'application/json' });
    res.end(JSON.stringify({ message: 'Hello!' }));
  } else {
    done(); // 404 for unknown routes
  }
});

server.listen(3000);
export default httpServerHandler({ port: 3000 });

flat

βœ… Works
v6.0.1 20,706,924 weekly downloads utility

Flatten/unflatten nested objects. Use named imports: import { flatten, unflatten } from flat

View Example
import { flatten, unflatten } from 'flat';

const flat = flatten({ a: { b: 1 } });
// { 'a.b': 1 }

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

formidable

πŸ”„ Alternative Available
v3.5.4 13,250,915 weekly downloads server-framework

Formidable is a Node.js form parsing library for handling multipart/form-data, especially file uploads, in traditional Node.js HTTP servers (http.createServer). Requires node:os module which is not supported in Workers nodejs_compat (only crypto, fs, path, buffer, stream, events, util, http, https, net, dns, zlib, timers, url, assert, process, diagnostics_channel, async_hooks are supported). Designed for Node.js request/response objects and filesystem-based temporary file storage during upload processing. Workers uses Request/Response objects and has better alternatives for form parsing.

πŸ’‘ Alternative: Workers Request.formData() API (native multipart/form-data parsing built-in), or busboy (lower-level multipart parser that may work with Workers)

Error: No such module "node:os".

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

front-matter

βœ… Works
v4.0.2 4,731,919 weekly downloads parsing

Extracts YAML front matter from markdown files. Commonly used in static site generators.

View Example
import fm from 'front-matter';

// Usage:
const content = `---
title: Hello World
date: 2026-01-09
tags: [test, markdown]
---

# Article Content

This is the body of the article.
`;
const parsed = fm(content);
return { 
  success: parsed.attributes.title === 'Hello World' && parsed.body.includes('Article Content'),
  result: { attributes: parsed.attributes, bodyLength: parsed.body.length }
};

fs

⚠️ Works (with notes)
v0.0.1-security 1,737,672 weekly downloads utility

Node.js fs module is available but operates on a virtual in-memory filesystem. No persistent storage - files are lost between requests. Use R2, KV, or D1 for persistent storage.

View Example
import * as fs from 'node:fs';

// Usage:
const result = { existsSync: typeof fs.existsSync === 'function', readFileSync: typeof fs.readFileSync === 'function' };
return { success: result.existsSync && result.readFileSync, result };

fs-promise

πŸ”„ Alternative Available
v2.0.3 152,415 weekly downloads filesystem-tool

DEPRECATED package (last updated 2017). Official deprecation message: 'Use mz or fs-extra^3.0 with Promise Support'. This was a promise wrapper for Node.js filesystem operations (fs.readFile, fs.writeFile, etc.) before native fs.promises API existed in Node.js. Modern Node.js (10+) has native fs.promises built-in. Workers has limited virtual filesystem via nodejs_compat - no persistent storage. For file storage in Workers, use R2 (object storage), KV (key-value), or D1 (database).

πŸ’‘ Alternative: R2 for object storage, KV for key-value, D1 for database, or native fs.promises in modern Node.js (if targeting Node.js)

generic-pool

βœ… Works
v3.9.0 5,787,249 weekly downloads async

Generic resource pooling. Useful for managing database connections or API clients.

View Example
import { createPool } from 'generic-pool';

const pool = createPool({
  create: async () => ({ id: Date.now() }),
  destroy: async (r) => {}
}, { max: 10 });

const resource = await pool.acquire();
await pool.release(resource);

github

πŸ”„ Alternative Available
v14.0.0 54,591 weekly downloads api-client

DEPRECATED! Package renamed to @octokit/rest. The 'github' package is the old GitHub API client library that has been superseded by @octokit/rest which is the official GitHub REST API client for Node.js/browser maintained by GitHub. Provides comprehensive GitHub API integration: repositories (create/read/update/delete), issues/PRs (list/create/comment/merge), users/orgs (profiles/memberships), gists (create/update), notifications, search, git data operations. @octokit/rest has better TypeScript support, active maintenance, OAuth2/token authentication, pagination helpers, rate limit handling, and webhooks support. Works in Node.js and browsers with fetch API. Similar GitHub API libraries include @octokit/graphql (GraphQL API), octonode (alternative client), github-api (community client).

πŸ’‘ Alternative: @octokit/rest (official successor, actively maintained by GitHub) - works on Workers with fetch API

Error: 'github' has been renamed to '@octokit/rest' (https://git.io/vNB11)

global

βœ… Works
v4.4.0 5,055,232 weekly downloads utility

Polyfill for accessing the global object across environments. Returns globalThis in Workers. Useful for cross-environment compatibility.

View Example
import global from 'global';

// Usage:
// global is a polyfill for accessing global variables across environments
// It returns the global object (globalThis in Workers)
const hasGlobal = typeof global === 'object';
const hasGlobalThis = global === globalThis;
return { success: hasGlobal && hasGlobalThis, result: { type: typeof global, isGlobalThis: hasGlobalThis } };

googleapis

πŸ”„ Alternative Available
v170.0.0 4,872,751 weekly downloads api-client

googleapis is Google's official Node.js client library for accessing 200+ Google APIs (Drive, Gmail, YouTube, Calendar, etc.) with OAuth2, API keys, and service account authentication. Error "No such module 'node:child_process'" indicates it requires child_process (non-functional stub in Workers) for internal operations like gRPC connections or auth flows. The monolithic googleapis package bundles all Google API clients (200+ APIs, 200 MB unpacked) with shared auth infrastructure. Designed for traditional Node.js servers with full Node.js API access. For Google APIs in Workers, use better alternatives: (1) @googleapis/* scoped packages (e.g., @googleapis/drive, @googleapis/gmail) - individual API packages that may work better in Workers with tree-shaking and smaller bundles, needs testing per API; (2) Direct Google REST APIs - call Google API endpoints directly using Workers' native fetch() with manual OAuth2/API key auth headers for full control; (3) @google-cloud/* packages for GCP services (e.g., @google-cloud/storage for Cloud Storage instead of Drive API) - purpose-built clients for Google Cloud Platform services that may have better Workers support. Most Google APIs are REST-based and should work via fetch(), but the googleapis package's Node.js dependencies make it incompatible. Similar monolithic API client libraries include aws-sdk (AWS SDK v2, deprecated), azure-sdk (Azure services).

πŸ’‘ Alternative: @googleapis/* scoped packages (e.g., @googleapis/drive) - individual API packages that may work in Workers, or direct Google REST API calls using fetch()

Error: No such module "node:child_process".

graphql

βœ… Works
v16.12.0 21,372,329 weekly downloads parsing

Full GraphQL implementation: schema building (SDL or programmatic), query parsing, validation, and execution. Build complete GraphQL APIs on Workers.

View Example
import { graphql, buildSchema, parse, validate, GraphQLSchema, GraphQLObjectType, GraphQLString } from 'graphql';

export default {
  async fetch(request) {
    // SDL-based schema
    const schema = buildSchema(`
      type Query {
        hello: String
        user(id: Int!): User
      }
      type User { id: Int, name: String }
    `);
    const root = {
      hello: () => 'Hello from Workers!',
      user: ({ id }) => ({ id, name: 'User ' + id })
    };
    
    const result = await graphql({
      schema,
      source: '{ hello user(id: 1) { name } }',
      rootValue: root
    });
    
    return Response.json(result);
  }
};

graphql-tag

βœ… Works
v2.12.6 8,110,539 weekly downloads parsing

GraphQL query parser for template literals

View Example
import gql from 'graphql-tag';

// Usage:
const query = gql`
  query GetUser($id: ID!) {
    user(id: $id) {
      name
      email
    }
  }
`;
return { success: query.kind === 'Document' && query.definitions.length > 0, result: { kind: query.kind, definitions: query.definitions.length } };

graphql-tools

βœ… Works
v9.0.26 674,986 weekly downloads utility

GraphQL schema building utilities - makeExecutableSchema, mergeSchemas, schema stitching

View Example
import { makeExecutableSchema } from 'graphql-tools';

// Usage:
// Create a simple GraphQL schema
const typeDefs = `
  type Query {
    hello: String
  }
`;
const resolvers = {
  Query: {
    hello: () => 'Hello from Workers!'
  }
};
const schema = makeExecutableSchema({ typeDefs, resolvers });
return { 
  success: schema != null && schema.getQueryType()?.name === 'Query',
  result: { hasSchema: true, queryType: schema.getQueryType()?.name }
};

gray-matter

βœ… Works
v4.0.3 2,672,665 weekly downloads parsing

Parse YAML/JSON front matter from markdown strings. Supports custom delimiters, stringify for generating front matter, and excerpts. TOML requires additional engine config.

View Example
import matter from 'gray-matter';

export default {
  async fetch(request) {
    // Parse YAML front matter
    const markdown = `---
title: My Post
date: 2024-01-15
tags: [js, workers]
---

# Content Here`;
    const { data, content } = matter(markdown);
    
    // JSON front matter
    const json = `---json
{"title": "JSON"}
---
Content`;
    const jsonParsed = matter(json);
    
    // Stringify back to front matter
    const output = matter.stringify('New content', { title: 'Generated' });
    
    return Response.json({ yaml: data, json: jsonParsed.data, output });
  }
};

grpc

πŸ”„ Alternative Available
vunknown 103,505 weekly downloads native-module

DEPRECATED native module (C++ bindings via node-gyp) - official gRPC Node.js library that requires native compilation. Error 'spawnSync /bin/sh ETIMEDOUT' confirms it tries to compile C++ code during installation. The package provides gRPC client/server implementations with protocol buffer support, service definitions, client stubs, server implementations, streaming (unary, client streaming, server streaming, bidirectional), authentication (SSL/TLS, OAuth2, custom), metadata handling, and interceptors. Used for microservices communication with strongly-typed RPC calls, high-performance inter-service communication, polyglot systems (cross-language RPC), streaming data pipelines, and service mesh architectures. Native modules with C++ bindings cannot run in Workers' serverless JavaScript environment - no compilation/linking at runtime, no access to native code. The grpc team officially recommends using @grpc/grpc-js instead - a pure JavaScript implementation that provides the same gRPC functionality without native dependencies. @grpc/grpc-js offers: (1) Pure JavaScript - no native compilation required, (2) Drop-in replacement - same API as native grpc, (3) Active maintenance - regularly updated with latest gRPC features, (4) Better compatibility - works in more environments including Workers. Similar RPC libraries include @grpc/proto-loader (proto file loading), grpc-web (@grpc/grpc-web for browser gRPC), connect-node (modern RPC with gRPC support).

πŸ’‘ Alternative: @grpc/grpc-js (official pure JavaScript implementation, drop-in replacement recommended by gRPC team)

hapi

πŸ”„ Alternative Available
v18.1.0 37,975 weekly downloads framework

Node.js HTTP server framework - Workers uses fetch() handlers

πŸ’‘ Alternative: hono, itty-router

hash-sum

βœ… Works
v2.0.0 3,803,042 weekly downloads utility
View Example
import hashSum from 'hash-sum';

// Usage:
const hash = hashSum({ foo: 'bar', nested: { value: 123 } });
return { success: typeof hash === 'string' && hash.length > 0, result: hash };

hash.js

βœ… Works
v1.1.7 11,520,802 weekly downloads crypto

Pure JavaScript hash functions (SHA256, SHA512, RIPEMD160). Works on Workers.

View Example
import { sha256, sha512 } from 'hash.js';

const hash = sha256().update('hello world').digest('hex');
return { success: hash.length === 64, hash };

he

βœ… Works
v1.2.0 25,328,575 weekly downloads utility

HTML entity encoder/decoder. Encode/decode HTML entities in strings.

View Example
import he from 'he';

// Usage:
const encoded = he.encode('<script>alert("xss")</script>');
const decoded = he.decode('&lt;div&gt;Hello&lt;/div&gt;');
return { success: decoded === '<div>Hello</div>', result: { encoded, decoded } };

helmet

βœ… Works
v8.1.0 5,633,561 weekly downloads middleware

Express middleware for setting security HTTP headers (CSP, HSTS, X-Frame-Options, etc). Works with Express via httpServerHandler.

View Example
import { httpServerHandler } from 'cloudflare:node';
import express from 'express';
import helmet from 'helmet';

const app = express();
app.use(helmet());

app.get('/test', (req, res) => {
  res.json({ secure: true });
});

app.listen(3000);
export default httpServerHandler({ port: 3000 });

highland

βœ… Works
v2.13.5 100,813 weekly downloads utility
View Example
import H from 'highland';

// Usage:
const result: number[] = [];
H([1, 2, 3, 4])
  .map((x: number) => x * 2)
  .each((x: number) => result.push(x));
return { success: result.join(',') === '2,4,6,8', result };

highlight.js

βœ… Works
v11.11.1 12,301,054 weekly downloads utility

Syntax highlighting library

View Example
import hljs from 'highlight.js';

// Usage:
const result = hljs.highlight('const x = 5;', { language: 'javascript' });
return { success: result.value.includes('const'), result: { highlighted: result.value.substring(0, 50) } };

hiredis

πŸ”„ Alternative Available
vunknown 5,615 weekly downloads native-module

Native C++ Redis client

πŸ’‘ Alternative: ioredis

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

history

βœ… Works
v5.3.0 7,530,039 weekly downloads utility

History/routing library for SPAs

View Example
import { createMemoryHistory } from 'history';

// Usage:
const history = createMemoryHistory();
history.push('/test');
return { success: history.location.pathname === '/test', result: { pathname: history.location.pathname } };

hoek

πŸ”„ Alternative Available
v6.1.3 2,186,482 weekly downloads utility

Deprecated - use @hapi/hoek instead

πŸ’‘ Alternative: @hapi/hoek

Error: Failed to load url @hapi/hoek (resolved id: @hapi/hoek) in /Users/steve/works-on-workers/packages/test-harness/sandbox/hoek/src/index.ts. Does the file exist?

hogan.js

βœ… Works
v3.0.2 752,163 weekly downloads utility
View Example
import Hogan from 'hogan.js';

// Usage:
const template = Hogan.compile('Hello {{name}}!');
const result = template.render({ name: 'World' });
return { success: result === 'Hello World!', result };
v3.3.2 22,485,728 weekly downloads utility

Copies non-React static properties

View Example
import hoistStatics from 'hoist-non-react-statics';

// Usage:
function Target() {}
function Source() {}
Source.foo = 'bar';
hoistStatics(Target, Source);
return { success: (Target as any).foo === 'bar', result: { foo: (Target as any).foo } };

hono

βœ… Works
v4.11.3 9,047,483 weekly downloads framework

Ultra-fast web framework built specifically for edge/Workers. Includes middleware (cors, logger, jwt, validator), routing, context helpers. Recommended for building APIs on Workers.

View Example
import { Hono } from 'hono';
import { cors } from 'hono/cors';
import { prettyJSON } from 'hono/pretty-json';

const app = new Hono();
app.use('*', cors());
app.use('*', prettyJSON());

app.get('/', (c) => c.json({ message: 'Hello!' }));
app.get('/users/:id', (c) => c.json({ userId: c.req.param('id') }));
app.post('/data', async (c) => c.json({ body: await c.req.json() }));

export default app;

html-entities

βœ… Works
v2.6.0 22,330,298 weekly downloads utility
View Example
import { encode, decode } from 'html-entities';

// Usage:
const encoded = encode('<div>Hello & goodbye</div>');
const decoded = decode('&lt;div&gt;Hello &amp; goodbye&lt;/div&gt;');
return { success: encoded === '&lt;div&gt;Hello &amp; goodbye&lt;/div&gt;' && decoded === '<div>Hello & goodbye</div>', result: { encoded, decoded } };

htmlparser2

βœ… Works
v10.0.0 43,886,770 weekly downloads parsing

Fast streaming HTML/XML parser with DOM utilities. Use with dom-serializer for HTML output. Good alternative to cheerio for lower-level parsing.

View Example
import { parseDocument, DomUtils } from 'htmlparser2';
import render from 'dom-serializer';

export default {
  async fetch(request) {
    const response = await fetch('https://example.com');
    const html = await response.text();
    const dom = parseDocument(html);
    
    // Find elements
    const h1 = DomUtils.findOne(el => el.name === 'h1', dom.children, true);
    const title = h1 ? DomUtils.textContent(h1) : null;
    const links = DomUtils.findAll(el => el.name === 'a', dom.children, true);
    
    // Serialize back to HTML
    const serialized = render(dom);
    
    return Response.json({ title, linkCount: links.length });
  }
};

http

🏠 Built into Workers
vunknown 253,650 weekly downloads node-polyfill

Built-in Node.js module, polyfilled in Workers

http-errors

βœ… Works
v2.0.1 81,050,968 weekly downloads utility

Create HTTP errors with proper status codes. Useful for API error responses.

View Example
import createError from 'http-errors';

// Usage:
const err = createError(404, 'User not found');
return { success: err.status === 404, result: { status: err.status, message: err.message } };

http-proxy

βœ… Works
v1.18.1 17,130,424 weekly downloads other

HTTP proxy server - use with httpServerHandler from cloudflare:node

View Example
import httpProxy from 'http-proxy';

// Usage:
// http-proxy creates HTTP proxy servers - requires node:http server APIs
const proxy = httpProxy.createProxyServer();
return { success: true, result: 'HTTP proxy created' };

http-proxy-middleware

⚠️ Works (with notes)
vunknown 18,028,204 weekly downloads middleware

HTTP proxy middleware for Express/Connect. Works with httpServerHandler but the actual proxying may have issues with some request types. Simple proxy forwarding works. For complex proxy needs, consider using native fetch() directly.

πŸ’‘ Alternative: Use native fetch() for proxying requests

View Example
import { httpServerHandler } from 'cloudflare:node';
import express from 'express';
import { createProxyMiddleware } from 'http-proxy-middleware';

const app = express();

// Note: Basic proxying works but may have edge cases
const apiProxy = createProxyMiddleware({
  target: 'https://api.example.com',
  changeOrigin: true
});

app.use('/api', apiProxy);
app.get('/', (req, res) => res.json({ message: 'Proxy ready' }));

app.listen(3000);
export default httpServerHandler({ port: 3000 });

http-status-codes

βœ… Works
v2.3.0 5,222,650 weekly downloads utility
View Example
import { StatusCodes, getReasonPhrase } from 'http-status-codes';

// Usage:
const ok = StatusCodes.OK;
const notFound = StatusCodes.NOT_FOUND;
const phrase = getReasonPhrase(200);
return { success: ok === 200 && notFound === 404 && phrase === 'OK', result: { ok, notFound, phrase } };

https

🏠 Built into Workers
v1.0.0 998,837 weekly downloads node-polyfill

Built-in Node.js module, polyfilled in Workers

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

i18next

βœ… Works
v25.7.4 10,001,051 weekly downloads utility

Internationalization framework with interpolation, pluralization, language detection, fallbacks. Works on Workers for multi-language APIs.

View Example
import i18next from 'i18next';

export default {
  async fetch(request) {
    await i18next.init({
      lng: 'en',
      fallbackLng: 'en',
      resources: {
        en: { translation: { greeting: 'Hello, {{name}}!', welcome: 'Welcome' } },
        es: { translation: { greeting: 'Β‘Hola, {{name}}!', welcome: 'Bienvenido' } }
      }
    });
    
    const en = i18next.t('greeting', { name: 'World' });
    await i18next.changeLanguage('es');
    const es = i18next.t('greeting', { name: 'Mundo' });
    
    return Response.json({ en, es });
  }
};

iconv-lite

βœ… Works
v0.7.2 131,684,237 weekly downloads utility
View Example
import iconv from 'iconv-lite';

// Usage:
const encoded = iconv.encode('Hello', 'utf8');
const decoded = iconv.decode(encoded, 'utf8');
return { success: decoded === 'Hello', result: decoded };
v3.0.0 7,294,528 weekly downloads other
View Example
import identityObj from 'identity-obj-proxy';

// Usage:
// Identity proxy returns property names as values (for testing)
const result = identityObj.foo === 'foo' && identityObj.bar === 'bar';
return { success: result, result: { foo: identityObj.foo, bar: identityObj.bar } };

image-size

βœ… Works
v2.0.2 15,015,579 weekly downloads utility

Get image dimensions from buffer or file

View Example
import sizeOf from 'image-size';

// Usage:
// Create a simple 1x1 PNG (base64 encoded)
const pngData = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==', 'base64');
const dimensions = sizeOf(pngData);
return { success: dimensions.width === 1 && dimensions.height === 1 && dimensions.type === 'png', result: dimensions };

immer

βœ… Works
v11.1.3 20,904,024 weekly downloads utility

Immutable state updates with mutable syntax. Supports nested objects, arrays, Maps, Sets. Great for state management in Workers.

View Example
import { produce, enableMapSet } from 'immer';
enableMapSet();

export default {
  async fetch(request) {
    const state = {
      users: [{ id: 1, name: 'Alice' }],
      settings: { theme: 'light' }
    };
    
    const nextState = produce(state, draft => {
      draft.users.push({ id: 2, name: 'Bob' });
      draft.settings.theme = 'dark';
    });
    
    // Curried producer
    const addUser = produce((draft, user) => { draft.users.push(user); });
    const withNewUser = addUser(nextState, { id: 3, name: 'Charlie' });
    
    return Response.json({ original: state, updated: withNewUser });
  }
};
v3.1.1 706,564 weekly downloads utility

Immutable state updates for React and other frameworks

View Example
import update from 'immutability-helper';

// Usage:
const state = { name: 'Alice', age: 30 };
const newState = update(state, { age: { $set: 31 } });
return { success: newState.age === 31 && state.age === 30, result: newState };

immutable

βœ… Works
v5.1.4 25,944,375 weekly downloads utility
View Example
import { Map } from 'immutable';

// Usage:
const map = Map({ a: 1, b: 2 });
const map2 = map.set('c', 3);
return { success: map2.get('c') === 3 && map2.size === 3, result: map2.toObject() };

inflection

βœ… Works
v3.0.2 3,586,004 weekly downloads utility
View Example
import inflection from 'inflection';

// Usage:
const plural = inflection.pluralize('person');
const singular = inflection.singularize('people');
const camel = inflection.camelize('hello_world');
return { success: plural === 'people' && singular === 'person' && camel === 'HelloWorld', result: { plural, singular, camel } };

inherits

βœ… Works
v2.0.4 101,029,953 weekly downloads utility
View Example
import inherits from 'inherits';

// Usage:
function Parent() { this.name = 'parent'; }
Parent.prototype.getName = function() { return this.name; };
function Child() { Parent.call(this); this.name = 'child'; }
inherits(Child, Parent);
const child = new Child();
return { success: child.getName() === 'child', result: child.getName() };

ini

βœ… Works
v6.0.0 85,114,003 weekly downloads utility
View Example
import ini from 'ini';

// Usage:
const obj = { section: { key: 'value', number: 42 } };
const str = ini.stringify(obj);
const parsed = ini.parse(str);
return { success: parsed.section.key === 'value', result: parsed };

intl

🏠 Built into Workers
v1.2.5 590,907 weekly downloads polyfill

Intl API is built into Workers runtime

v11.0.9 7,860,612 weekly downloads other
View Example
import { IntlMessageFormat } from 'intl-messageformat';

// Usage:
const msg = new IntlMessageFormat('Hello {name}!', 'en-US');
const result = msg.format({ name: 'World' });
return { success: result === 'Hello World!', result };

invariant

βœ… Works
v2.2.4 17,148,143 weekly downloads utility
View Example
import invariant from 'invariant';

// Usage:
let error;
try {
  invariant(false, 'This is an error');
} catch (e) {
  error = e.message;
}
return { success: error === 'This is an error', result: error };

inversify

βœ… Works
v7.11.0 1,661,178 weekly downloads utility

IoC container with dependency injection

View Example
import { Container, injectable, inject } from 'inversify';

// Usage:
@injectable()
class Warrior {
  constructor() {}
  fight() { return 'fight!'; }
}
const container = new Container();
container.bind(Warrior).toSelf();
const warrior = container.get(Warrior);
return { success: warrior.fight() === 'fight!', result: warrior.fight() };

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

ip

βœ… Works
v2.0.1 8,435,636 weekly downloads utility

IP address utilities - validation, parsing, subnet checking, IPv4/IPv6 conversion.

View Example
import ip from 'ip';

// Usage:
const isPrivate = ip.isPrivate('192.168.1.1');
const isPublic = ip.isPublic('8.8.8.8');
return { success: isPrivate && isPublic, result: { isPrivate, isPublic } };

is-number

βœ… Works
v7.0.0 88,720,614 weekly downloads utility
View Example
import isNumber from 'is-number';

// Usage:
const results = [isNumber(123), isNumber('123'), isNumber('abc'), isNumber(null)];
return { success: results[0] && results[1] && !results[2] && !results[3], result: results };

is-plain-object

βœ… Works
v5.0.0 46,226,431 weekly downloads type-checking
View Example
import { isPlainObject } from 'is-plain-object';

// Usage:
const r1 = isPlainObject({});
const r2 = isPlainObject([]);
return { success: r1 && !r2, result: { object: r1, array: r2 } };

is-promise

βœ… Works
v4.0.0 25,087,356 weekly downloads utility
View Example
import isPromise from 'is-promise';

// Usage:
const a = isPromise(Promise.resolve(123));
const b = isPromise({ then: () => {} });
const c = isPromise(123);
return { success: a === true && b === true && c === false, result: { a, b, c } };

is-url

βœ… Works
v1.2.4 7,023,699 weekly downloads validation

Validate if a string is a valid URL

View Example
import isUrl from 'is-url';

// Usage:
const results = [
  isUrl('https://example.com'),
  isUrl('http://example.com/path'),
  isUrl('not a url'),
  isUrl('example.com')
];
return { success: results[0] && results[1] && !results[2] && !results[3], result: results };

isobject

βœ… Works
v4.0.0 40,701,769 weekly downloads utility
View Example
import isObject from 'isobject';

// Usage:
const results = [isObject({}), isObject([]), isObject(null), isObject('test')];
return { success: results[0] && !results[1] && !results[2] && !results[3], result: results };

isomorphic-fetch

βœ… Works
v3.0.0 5,635,381 weekly downloads other
View Example
import 'isomorphic-fetch';

// Usage:
// isomorphic-fetch polyfills fetch globally
const result = typeof fetch === 'function';
return { success: result, result: 'fetch is available' };

itty-router

βœ… Works
v5.0.22 116,412 weekly downloads framework

Tiny (~1KB) router built for Workers. v5 uses AutoRouter for automatic JSON responses. Supports params, query strings, middleware. Simpler than Hono but less features.

View Example
import { AutoRouter } from 'itty-router';

const router = AutoRouter();

// Routes return objects - auto-converted to JSON
router.get('/', () => ({ message: 'Hello!' }));
router.get('/users/:id', ({ id }) => ({ userId: id }));
router.get('/search', (req) => {
  const url = new URL(req.url);
  return { query: url.searchParams.get('q') };
});
router.post('/data', async (req) => ({ body: await req.json() }));

export default router;

jimp

βœ… Works
v1.6.0 1,705,027 weekly downloads utility

JavaScript image manipulation. Pure JS image processing - resize, crop, rotate, filters, etc.

View Example
import { Jimp } from 'jimp';

// Usage:
const image = new Jimp({ width: 100, height: 100, color: 0xff0000ff });
return { success: true, result: { width: image.width, height: image.height } };

joi

βœ… Works
v18.0.2 13,183,645 weekly downloads validation

Powerful schema validation with nested objects, arrays, conditionals, custom messages. Works on Workers unlike ajv (which uses new Function).

View Example
import Joi from 'joi';

export default {
  async fetch(request) {
    const userSchema = Joi.object({
      username: Joi.string().alphanum().min(3).max(30).required(),
      email: Joi.string().email().required(),
      age: Joi.number().integer().min(0).max(120),
      role: Joi.string().valid('admin', 'user').default('user')
    });
    
    const body = await request.json();
    const { error, value } = userSchema.validate(body, { abortEarly: false });
    
    if (error) {
      return Response.json({ errors: error.details.map(d => d.message) }, { status: 400 });
    }
    return Response.json({ valid: true, data: value });
  }
};

jose

βœ… Works
v6.1.3 28,810,541 weekly downloads crypto

Recommended JWT library for Workers. Supports JWT signing/verification (HS256, RS256, ES256), JWE encryption, JWK key management. Uses Web Crypto API - perfect for edge.

View Example
import * as jose from 'jose';

export default {
  async fetch(request) {
    // Sign JWT with HS256
    const secret = new TextEncoder().encode('my-secret-32-chars-minimum-key!');
    const jwt = await new jose.SignJWT({ sub: 'user123', role: 'admin' })
      .setProtectedHeader({ alg: 'HS256' })
      .setIssuedAt()
      .setExpirationTime('2h')
      .sign(secret);
    
    // Verify JWT
    const { payload } = await jose.jwtVerify(jwt, secret);
    
    // RSA key pair
    const { publicKey, privateKey } = await jose.generateKeyPair('RS256');
    
    // Encrypted JWT (JWE)
    const key = await jose.generateSecret('A256GCM');
    const jwe = await new jose.EncryptJWT({ secret: 'data' })
      .setProtectedHeader({ alg: 'dir', enc: 'A256GCM' })
      .encrypt(key);
    
    return Response.json({ jwt, payload });
  }
};

js-base64

βœ… Works
v3.7.8 7,669,532 weekly downloads utility
View Example
import { Base64 } from 'js-base64';

// Usage:
const encoded = Base64.encode('hello');
const decoded = Base64.decode(encoded);
return { success: decoded === 'hello', result: { encoded, decoded } };

js-beautify

βœ… Works
v1.15.4 5,579,510 weekly downloads utility
View Example
import beautify from 'js-beautify';

// Usage:
const result = beautify('var x=1;', { indent_size: 2 });
return { success: result.includes('var x'), result };

js-cookie

⚠️ Works (with notes)
v3.0.5 14,759,858 weekly downloads utility

Browser cookie library - requires document.cookie. In Workers, parse Cookie header manually or use a server-side cookie library.

View Example
import Cookies from 'js-cookie';

// Usage: js-cookie needs document.cookie (browser only)
// In Workers, parse cookies manually from request headers
const cookieHeader = request.headers.get('Cookie') || '';
return { success: true, result: { note: 'Use request.headers.get("Cookie") in Workers' } };

js-sha256

βœ… Works
v0.11.1 2,288,094 weekly downloads crypto
View Example
import sha256 from 'js-sha256';

// Usage:
const result = sha256('hello');
return { success: result.length === 64, result };

js-yaml

βœ… Works
v4.1.1 133,314,380 weekly downloads parsing
View Example
import yaml from 'js-yaml';

// Usage:
const obj = yaml.load('name: Alice\nage: 30');
return { success: true, result: obj };
v1.3.0 8,120,129 weekly downloads utility
View Example
import stringify from 'json-stable-stringify';

// Usage:
const result = stringify({ b: 2, a: 1 });
return { success: result === '{"a":1,"b":2}', result };
v5.0.1 25,221,986 weekly downloads utility
View Example
import stringify from 'json-stringify-safe';

// Usage:
const obj: any = { a: 1 };
obj.circular = obj;
const result = stringify(obj);
return { success: result.includes('"a":1'), result };

json5

βœ… Works
v2.2.3 100,226,531 weekly downloads utility
View Example
import JSON5 from 'json5';

// Usage:
const obj = JSON5.parse('{ key: "value", /* comment */ }');
return { success: obj.key === 'value', result: obj };

jsonfile

⚠️ Works (with notes)
v6.2.0 71,095,024 weekly downloads utility

Works with Workers node:fs support. Can read/write JSON files to /tmp (ephemeral, per-request) or read from /bundle (bundled files, read-only). Not for persistent storage - use KV, R2, or D1 for that.

Error: no such file or directory

View Example
import jsonfile from 'jsonfile';
import { mkdirSync } from 'node:fs';

export default {
  async fetch(request) {
    // Write JSON to /tmp (ephemeral, per-request)
    mkdirSync('/tmp/data', { recursive: true });
    const data = { name: 'test', timestamp: Date.now() };
    jsonfile.writeFileSync('/tmp/data/config.json', data, { spaces: 2 });
    
    // Read it back
    const result = jsonfile.readFileSync('/tmp/data/config.json');
    return Response.json({ written: data, readBack: result });
  }
};

jsonschema

βœ… Works
v1.5.0 4,321,840 weekly downloads utility
View Example
import { Validator } from 'jsonschema';

// Usage:
const v = new Validator();
const result = v.validate({ name: 'test' }, { type: 'object', properties: { name: { type: 'string' } } });
return { success: result.valid, result: result.valid };

JSONStream

βœ… Works
v1.3.5 9,207,147 weekly downloads utility

Streaming JSON parser

View Example
import JSONStream from 'JSONStream';

// Usage:
const stream = JSONStream.parse('*');
return { success: stream !== undefined && typeof stream.pipe === 'function', result: 'Stream created' };

jsonwebtoken

βœ… Works
v9.0.3 26,205,857 weekly downloads crypto
View Example
import jwt from 'jsonwebtoken';

// Usage:
const token = jwt.sign({ sub: '123' }, 'secret');
const decoded = jwt.verify(token, 'secret');
return { success: decoded.sub === '123', result: decoded };

jszip

βœ… Works
v3.10.1 14,971,239 weekly downloads compression

Create, read, and edit ZIP files in JavaScript

View Example
import JSZip from 'jszip';

// Usage:
const zip = new JSZip();
zip.file('hello.txt', 'Hello World!');
const content = await zip.generateAsync({ type: 'blob' });
return { success: content.size > 0, result: { size: content.size } };

jwt-decode

βœ… Works
v4.0.0 10,129,028 weekly downloads utility
View Example
import { jwtDecode } from 'jwt-decode';

// Usage:
const token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c';
const decoded = jwtDecode(token);
return { success: decoded.sub === '1234567890' && decoded.name === 'John Doe', result: decoded };

kind-of

βœ… Works
v6.0.3 86,536,305 weekly downloads utility
View Example
import kindOf from 'kind-of';

// Usage:
const result = [kindOf('test'), kindOf(123), kindOf([]), kindOf({})];
return { success: result.join(',') === 'string,number,array,object', result };

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

koa

βœ… Works
v3.1.1 4,866,550 weekly downloads server-framework

Node.js web framework. Works on Workers with httpServerHandler from cloudflare:node. Requires nodejs_compat flag.

πŸ’‘ Alternative: hono, itty-router

Error: Unexpected token ':'

View Example
import { httpServerHandler } from 'cloudflare:node';
import Koa from 'koa';

const app = new Koa();
app.use(async (ctx) => {
  ctx.body = { message: 'Koa on Workers!' };
});

app.listen(3000);
export default httpServerHandler({ port: 3000 });

koa-body

πŸ”„ Alternative Available
v7.0.1 372,779 weekly downloads server-framework

Koa body parsing middleware

πŸ’‘ Alternative: hono, itty-router

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

koa-bodyparser

πŸ”„ Alternative Available
vunknown 559,649 weekly downloads server-framework

Koa body parsing middleware

πŸ’‘ Alternative: hono, itty-router

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

koa-compose

πŸ”„ Alternative Available
v4.1.0 4,255,382 weekly downloads server-framework

Koa middleware composition

πŸ’‘ Alternative: hono, itty-router

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

koa-logger

πŸ”„ Alternative Available
v4.0.0 256,519 weekly downloads server-framework

Koa logging middleware

πŸ’‘ Alternative: hono, itty-router

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

koa-router

πŸ”„ Alternative Available
v14.0.0 413,092 weekly downloads server-framework

Koa routing middleware

πŸ’‘ Alternative: hono, itty-router

Error: Unexpected token ':'

koa-static

πŸ”„ Alternative Available
v5.0.0 927,195 weekly downloads server-framework

Koa static file middleware

πŸ’‘ Alternative: hono, itty-router

Error: Unexpected token ':'

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

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

liquid

βœ… Works
v5.1.1 3,998 weekly downloads utility

Liquid template engine (Shopify templating). Use liquidjs package: import { Liquid } from "liquidjs"

View Example
import { Liquid } from 'liquidjs';

// Usage:
const engine = new Liquid();
const result = await engine.parseAndRender('Hello {{ name }}!', { name: 'World' });
return { success: result === 'Hello World!', result };

lodash

βœ… Works
v4.17.21 71,839,896 weekly downloads utility
View Example
import _ from 'lodash';

// Usage:
const result = _.chunk(['a', 'b', 'c', 'd'], 2);
return { success: true, result };

lodash-es

βœ… Works
v4.17.22 19,894,470 weekly downloads utility
View Example
import { chunk } from 'lodash-es';

// Usage:
const result = chunk(['a', 'b', 'c', 'd'], 2);
return { success: true, result };

lodash.assign

βœ… Works
v4.2.0 1,900,041 weekly downloads utility
View Example
import assign from 'lodash.assign';

// Usage:
const result = assign({}, { a: 1 }, { b: 2 });
return { success: result.a === 1 && result.b === 2, result };

lodash.camelcase

βœ… Works
v4.3.0 23,749,505 weekly downloads utility
View Example
import camelCase from 'lodash.camelcase';

// Usage:
const result = camelCase('foo-bar');
return { success: result === 'fooBar', result };

lodash.clonedeep

βœ… Works
v4.5.0 14,853,281 weekly downloads utility
View Example
import cloneDeep from 'lodash.clonedeep';

// Usage:
const obj = { a: { b: 1 } };
const clone = cloneDeep(obj);
clone.a.b = 2;
return { success: obj.a.b === 1 && clone.a.b === 2, result: { original: obj, clone } };

lodash.debounce

βœ… Works
v4.0.8 26,045,738 weekly downloads utility

Debounce function from lodash. Works in Workers for rate-limiting function calls.

View Example
import debounce from 'lodash.debounce';

// Usage:
let count = 0;
const fn = debounce(() => { count++; }, 50);
fn(); fn(); fn();
await new Promise(r => setTimeout(r, 100));
return { success: count === 1, result: { count } };

lodash.defaults

βœ… Works
v4.2.0 14,601,593 weekly downloads utility
View Example
import defaults from 'lodash.defaults';

// Usage:
const result = defaults({ a: 1 }, { a: 2, b: 3 });
return { success: result.a === 1 && result.b === 3, result };

lodash.flatten

βœ… Works
v4.4.0 8,845,991 weekly downloads utility
View Example
import flatten from 'lodash.flatten';

// Usage:
const result = flatten([[1, 2], [3, 4]]);
return { success: result.join(',') === '1,2,3,4', result };

lodash.foreach

βœ… Works
v4.5.0 1,826,089 weekly downloads utility
View Example
import forEach from 'lodash.foreach';

// Usage:
const result: number[] = [];
forEach([1, 2, 3], (n) => result.push(n * 2));
return { success: result.join(',') === '2,4,6', result };

lodash.get

βœ… Works
v4.4.2 13,222,312 weekly downloads utility
View Example
import get from 'lodash.get';

// Usage:
const obj = { a: { b: { c: 123 } } };
const result = get(obj, 'a.b.c');
const missing = get(obj, 'x.y.z', 'default');
return { success: result === 123 && missing === 'default', result: { result, missing } };

lodash.isempty

βœ… Works
v4.4.0 3,569,665 weekly downloads utility
View Example
import isEmpty from 'lodash.isempty';

// Usage:
const result = [isEmpty({}), isEmpty([]), isEmpty(''), isEmpty({ a: 1 })];
return { success: result[0] && result[1] && result[2] && !result[3], result };

lodash.isequal

βœ… Works
v4.5.0 12,891,162 weekly downloads utility
View Example
import isEqual from 'lodash.isequal';

// Usage:
const result1 = isEqual({ a: 1 }, { a: 1 });
const result2 = isEqual({ a: 1 }, { a: 2 });
return { success: result1 && !result2, result: { result1, result2 } };

lodash.isfunction

βœ… Works
v3.0.9 6,978,962 weekly downloads utility
View Example
import isFunction from 'lodash.isfunction';

// Usage:
const result = [isFunction(() => {}), isFunction({}), isFunction(null)];
return { success: result[0] && !result[1] && !result[2], result };
v4.0.6 31,003,319 weekly downloads utility
View Example
import isPlainObject from 'lodash.isplainobject';

// Usage:
const result = [isPlainObject({}), isPlainObject([]), isPlainObject(null)];
return { success: result[0] && !result[1] && !result[2], result };

lodash.isstring

βœ… Works
v4.0.1 24,441,721 weekly downloads utility
View Example
import isString from 'lodash.isstring';

// Usage:
const result = [isString('hello'), isString(123), isString(null)];
return { success: result[0] && !result[1] && !result[2], result };

lodash.map

βœ… Works
v4.6.0 2,234,597 weekly downloads utility
View Example
import map from 'lodash.map';

// Usage:
const result = map([1, 2, 3], n => n * 2);
return { success: result.join(',') === '2,4,6', result };

lodash.merge

βœ… Works
v4.6.2 52,711,103 weekly downloads utility
View Example
import merge from 'lodash.merge';

// Usage:
const result = merge({ a: 1, b: { c: 2 } }, { b: { d: 3 } });
return { success: result.a === 1 && result.b.c === 2 && result.b.d === 3, result };

lodash.omit

βœ… Works
v4.5.0 2,102,358 weekly downloads utility
View Example
import omit from 'lodash.omit';

// Usage:
const result = omit({ a: 1, b: 2, c: 3 }, ['a', 'c']);
return { success: result.b === 2 && !result.a, result };

lodash.pick

βœ… Works
v4.4.0 1,772,604 weekly downloads utility
View Example
import pick from 'lodash.pick';

// Usage:
const result = pick({ a: 1, b: 2, c: 3 }, ['a', 'c']);
return { success: result.a === 1 && result.c === 3 && !result.b, result };

lodash.set

βœ… Works
v4.3.2 1,677,968 weekly downloads utility
View Example
import set from 'lodash.set';

// Usage:
const obj = {};
set(obj, 'a.b.c', 123);
return { success: obj.a?.b?.c === 123, result: obj };

lodash.throttle

βœ… Works
v4.1.1 7,121,820 weekly downloads utility
View Example
import throttle from 'lodash.throttle';

// Usage:
const fn = throttle(() => 'throttled', 100);
const result = fn();
return { success: result === 'throttled', result };

lodash.uniq

βœ… Works
v4.5.0 18,050,195 weekly downloads utility
View Example
import uniq from 'lodash.uniq';

// Usage:
const result = uniq([1, 2, 2, 3, 1, 4]);
return { success: result.join(',') === '1,2,3,4', result };

log-symbols

βœ… Works
v7.0.1 50,885,030 weekly downloads utility
View Example
import logSymbols from 'log-symbols';

// Usage:
const result = {
  success: typeof logSymbols.success === 'string',
  error: typeof logSymbols.error === 'string',
  warning: typeof logSymbols.warning === 'string',
  info: typeof logSymbols.info === 'string',
};
return { success: result.success && result.error && result.warning && result.info, result };

log4js

πŸ”„ Alternative Available
v6.9.1 6,064,251 weekly downloads logging

Requires node:os which is not supported

πŸ’‘ Alternative: console or pino

Error: No such module "node:os".

loglevel

βœ… Works
v1.9.2 11,002,201 weekly downloads utility
View Example
import log from 'loglevel';

// Usage:
log.setLevel('info');
const level = log.getLevel();
log.info('test');
return { success: typeof level === 'number', result: { level } };

long

βœ… Works
v5.3.2 37,673,738 weekly downloads utility
View Example
import Long from 'long';

// Usage:
const val = Long.fromNumber(123456789);
const result = val.toString();
return { success: result === '123456789', result };

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

lru-cache

βœ… Works
v11.2.4 246,070,030 weekly downloads utility
View Example
import { LRUCache } from 'lru-cache';

// Usage:
const cache = new LRUCache({ max: 100 });
cache.set('key', 'value');
const result = cache.get('key');
return { success: result === 'value', result };

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

lz-string

βœ… Works
v1.5.0 20,102,447 weekly downloads utility
View Example
import LZString from 'lz-string';

// Usage:
const compressed = LZString.compress('hello world');
const decompressed = LZString.decompress(compressed);
return { success: decompressed === 'hello world', result: { compressed, decompressed } };

map-stream

βœ… Works
v0.0.7 4,706,052 weekly downloads utility

Stream mapping utility for transforming stream data

View Example
import mapStream from 'map-stream';

// Usage:
const stream = mapStream((data, callback) => {
  callback(null, data * 2);
});
return { success: typeof stream === 'object', result: 'stream-utility' };

markdown

βœ… Works
v0.5.0 68,140 weekly downloads utility

Markdown to HTML converter

View Example
import { markdown } from 'markdown';

// Usage:
const result = markdown.toHTML('# Hello');
return { success: result.includes('<h1>'), result };

markdown-it

βœ… Works
v14.1.0 11,897,715 weekly downloads utility

Markdown parser and renderer

View Example
import MarkdownIt from 'markdown-it';

// Usage:
const md = new MarkdownIt();
const result = md.render('# Hello World');
return { success: result.includes('<h1>') && result.includes('Hello World'), result };

marked

βœ… Works
v17.0.1 19,657,217 weekly downloads utility

Fast markdown parser and compiler

View Example
import { marked } from 'marked';

// Usage:
const result = marked('# Hello **World**');
return { success: result.includes('<h1>') && result.includes('<strong>'), result };

mathjs

βœ… Works
v15.1.0 1,673,706 weekly downloads utility

Extensive math library - expressions, matrices, units, big numbers, complex numbers.

View Example
import { evaluate, sqrt, multiply, matrix } from 'mathjs';

// Usage:
const expr = evaluate('2 + 3 * 4');
const sqrtResult = sqrt(16);
const m = multiply(matrix([[1, 2], [3, 4]]), 2);
return { success: expr === 14, result: { expr, sqrt: sqrtResult, matrix: m.toArray() } };

md5

βœ… Works
v2.3.0 9,286,807 weekly downloads crypto

MD5 hash function

View Example
import md5 from 'md5';

// Usage:
const result = md5('hello');
return { success: result === '5d41402abc4b2a76b9719d911017c592', result };

media-typer

βœ… Works
v1.1.0 54,670,925 weekly downloads utility

Parse and format media types (MIME types). Does not accept parameters in parse() - use content-type package for full parsing.

View Example
import typer from 'media-typer';

// Usage:
const parsed = typer.parse('text/html');
const formatted = typer.format({ type: 'application', subtype: 'json' });
return { success: parsed.type === 'text', result: { parsed, formatted } };

memoize-one

βœ… Works
v6.0.0 17,169,364 weekly downloads utility

Memoization with single result cache

View Example
import memoizeOne from 'memoize-one';

// Usage:
let calls = 0;
const fn = memoizeOne((a, b) => { calls++; return a + b; });
fn(1, 2); fn(1, 2); fn(2, 3);
return { success: calls === 2, result: { calls } };

memoizee

βœ… Works
v0.4.17 3,888,720 weekly downloads utility

Function memoization with TTL, max cache size, and async support.

πŸ’‘ Alternative: memoize-one

View Example
import memoize from 'memoizee';

// Usage:
let callCount = 0;
const expensive = memoize((x) => { callCount++; return x * 2; });
expensive(5); expensive(5); expensive(10);
return { success: callCount === 2, result: { callCount } };

merge

βœ… Works
v2.1.1 2,660,290 weekly downloads utility
View Example
import merge from 'merge';

// Usage:
const result = merge({ a: 1 }, { b: 2 });
return { success: result.a === 1 && result.b === 2, result };

merge-stream

βœ… Works
v2.0.0 62,150,297 weekly downloads utility

Utility for merging multiple readable streams into one. Works with Workers node:stream support.

View Example
import mergeStream from 'merge-stream';
import { Readable } from 'node:stream';

export default {
  async fetch(request) {
    // Create readable streams
    const stream1 = Readable.from(['Hello ', 'from ', 'stream1! ']);
    const stream2 = Readable.from(['And ', 'stream2 ', 'too!']);
    
    // Merge them
    const merged = mergeStream(stream1, stream2);
    
    // Collect all data
    const chunks = [];
    for await (const chunk of merged) {
      chunks.push(chunk);
    }
    
    return Response.json({ result: chunks.join('''') });
  }
};

method-override

βœ… Works
v3.0.0 1,139,539 weekly downloads other

Express middleware - requires HTTP framework

View Example
import methodOverride from 'method-override';

// Usage:
const fn = methodOverride();
return { success: typeof fn === 'function', result: 'middleware function' };

methods

βœ… Works
v1.1.2 35,786,711 weekly downloads utility

HTTP method name constants

View Example
import methods from 'methods';

// Usage:
return { success: Array.isArray(methods) && methods.includes('get'), result: methods.slice(0, 5) };

micromatch

βœ… Works
v4.0.8 83,662,805 weekly downloads utility
View Example
import micromatch from 'micromatch';

// Usage:
const result = micromatch(['foo.js', 'bar.txt'], '*.js');
return { success: result.length === 1 && result[0] === 'foo.js', result };

mime

βœ… Works
v4.1.0 81,484,694 weekly downloads utility

MIME type lookup by file extension. Useful for setting Content-Type headers.

View Example
import mime from 'mime';

const type = mime.getType('file.json'); // 'application/json'
const ext = mime.getExtension('text/html'); // 'html'
return { success: type === 'application/json', type, ext };

mime-db

πŸ”„ Alternative Available
v1.54.0 148,477,236 weekly downloads utility

ESM parsing issue with Workerd. Use 'mime' package instead which includes mime-db

πŸ’‘ Alternative: mime

mime-types

βœ… Works
v3.0.2 127,101,472 weekly downloads utility

MIME type lookup and extension detection. Works perfectly in Workers.

View Example
import mimeTypes from 'mime-types';

// Usage:
const type = mimeTypes.lookup('test.json');
const ext = mimeTypes.extension('application/json');
return { success: type === 'application/json', result: { type, ext } };

minimatch

βœ… Works
v10.1.1 344,146,182 weekly downloads utility
View Example
import { minimatch } from 'minimatch';

// Usage:
const result = minimatch('foo.js', '*.js');
return { success: result === true, result };

minimist

βœ… Works
v1.2.8 96,296,071 weekly downloads utility
View Example
import minimist from 'minimist';

// Usage:
const args = minimist(['--foo', 'bar', '-n', '3']);
return { success: args.foo === 'bar' && args.n === 3, result: args };

mitt

βœ… Works
v3.0.1 14,057,933 weekly downloads utility
View Example
import mitt from 'mitt';

// Usage:
const emitter = mitt();
let result = '';
emitter.on('test', (data) => { result = data; });
emitter.emit('test', 'hello');
return { success: result === 'hello', result };

mobx

βœ… Works
v6.15.0 2,242,168 weekly downloads utility
View Example
import { observable, autorun } from 'mobx';

// Usage:
const state = observable({ count: 0 });
let result = 0;
autorun(() => { result = state.count; });
state.count = 5;
return { success: result === 5, result };

mockjs

βœ… Works
v1.1.0 62,985 weekly downloads testing

Mock data generator

View Example
import Mock from 'mockjs';

// Usage:
const result = Mock.mock({ 'number|1-100': 1 });
return { success: typeof result.number === 'number', result };

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

moment-timezone

βœ… Works
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() } };

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

mqtt

⚠️ Works (with notes)
vunknown 1,458,185 weekly downloads network

MQTT client. Works with WebSocket transport (wss://). TCP connections not supported in Workers.

View Example
import mqtt from 'mqtt';

// Usage: MQTT needs WebSocket URL in Workers (not TCP)
const clientId = 'worker-' + Math.random().toString(16).slice(2, 8);
// const client = mqtt.connect('wss://broker.example.com:8884');
return { success: true, result: { clientId, note: 'Use wss:// WebSocket URL, not tcp://' } };

ms

βœ… Works
v2.1.3 295,115,826 weekly downloads utility

Parse/format milliseconds

View Example
import ms from 'ms';

// Usage:
const result = ms('2 days');
const str = ms(60000);
return { success: result === 172800000 && str === '1m', result: { parsed: result, formatted: str } };

msgpack-lite

βœ… Works
v0.1.26 951,521 weekly downloads utility

MessagePack serialization

View Example
import msgpack from 'msgpack-lite';

// Usage:
const data = { hello: 'world', num: 42 };
const encoded = msgpack.encode(data);
const decoded = msgpack.decode(encoded);
return { success: decoded.hello === 'world' && decoded.num === 42, result: decoded };

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

multer

βœ… Works
v2.0.2 8,596,833 weekly downloads middleware

Express middleware for handling multipart/form-data (file uploads). Works with memoryStorage - diskStorage not available in Workers.

Error: Unexpected token ':'

View Example
import { httpServerHandler } from 'cloudflare:node';
import express from 'express';
import multer from 'multer';

const app = express();
const upload = multer({ storage: multer.memoryStorage() });

app.post('/upload', upload.single('file'), (req, res) => {
  res.json({ filename: req.file.originalname, size: req.file.size });
});

app.listen(3000);
export default httpServerHandler({ port: 3000 });

multimatch

βœ… Works
v7.0.0 5,891,925 weekly downloads utility

Match files against glob patterns

View Example
import multimatch from 'multimatch';

// Usage:
const result = multimatch(['foo.js', 'bar.css', 'baz.html'], ['*.js', '*.css']);
return { success: result.length === 2 && result.includes('foo.js'), result };

mustache

βœ… Works
v4.2.0 8,242,711 weekly downloads utility

Logic-less template syntax

View Example
import Mustache from 'mustache';

// Usage:
const template = 'Hello {{name}}!';
const result = Mustache.render(template, { name: 'World' });
return { success: result === 'Hello World!', result };

mysql

πŸ”„ Alternative Available
v2.18.1 844,003 weekly downloads other

MySQL client - use Cloudflare D1, @planetscale/database, or mysql2 with TCP socket support

πŸ’‘ Alternative: @planetscale/database or mysql2

View Example
import * as pkg from 'mysql';

// Usage:
const keys = Object.keys(pkg);
return { success: keys.length > 0, result: { exports: keys.slice(0, 5) } };

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)

nanoid

βœ… Works
v5.1.6 70,264,131 weekly downloads id-generation
View Example
import { nanoid } from 'nanoid';

// Usage:
const id = nanoid();
return { success: id.length === 21, result: id };

nedb

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

In-memory/file-based database

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

needle

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

HTTP client

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

negotiator

βœ… Works
v1.0.0 95,937,326 weekly downloads utility
View Example
import Negotiator from 'negotiator';

// Usage:
const negotiator = new Negotiator({ headers: { accept: 'text/html,application/json;q=0.9' } });
const types = negotiator.mediaTypes();
return { success: types.includes('text/html'), result: types };

node-cache

βœ… Works
v5.1.2 3,800,157 weekly downloads utility

In-memory caching

View Example
import NodeCache from 'node-cache';

// Usage:
const cache = new NodeCache();
cache.set('key', 'value', 10);
const result = cache.get('key');
return { success: result === 'value', result };

node-emoji

βœ… Works
v2.2.0 8,671,143 weekly downloads utility

Emoji utilities - find, replace, parse emojis in text.

View Example
import * as emoji from 'node-emoji';

// Usage:
const result = emoji.emojify('I :heart: :coffee:!');
const hasEmoji = emoji.has(':heart:');
return { success: hasEmoji, result: { text: result, hasHeart: hasEmoji } };

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

node-forge

βœ… Works
v1.3.3 24,617,163 weekly downloads crypto

Cryptography utilities

View Example
import forge from 'node-forge';

// Usage:
const md = forge.md.sha256.create();
md.update('test');
const result = md.digest().toHex();
return { success: result.length === 64, result };

node-sass

πŸ”„ Alternative Available
vunknown 894,671 weekly downloads build-tool

Deprecated native Sass compiler

πŸ’‘ Alternative: sass

node-static

πŸ”„ Alternative Available
v0.7.11 55,225 weekly downloads cli-tool

Static file server for Node.js. While node:fs now works in Workers, node-static depends on Node.js stream and http internals that are not fully compatible. Use Workers Static Assets instead - it is the built-in, optimized solution.

πŸ’‘ Alternative: Workers Static Assets (https://developers.cloudflare.com/workers/static-assets/)

Error: ENOENT: no such file or directory

node-uuid

πŸ”„ Alternative Available
v1.4.8 769,541 weekly downloads uuid

Deprecated package. Use uuid or crypto.randomUUID()

πŸ’‘ Alternative: uuid

Error: Disallowed operation called within global scope. Asynchronous I/O (ex: fetch() or connect()), setting a timeout, and generating random values are not allowed within global scope. To fix this error, pe

node.extend

βœ… Works
v2.0.3 592,177 weekly downloads utility

Object extend utility

View Example
import extend from 'node.extend';

// Usage:
const obj1 = { a: 1, b: 2 };
const obj2 = { b: 3, c: 4 };
const result = extend(obj1, obj2);
return { success: result.a === 1 && result.b === 3 && result.c === 4, result };

nodegit

πŸ”„ Alternative Available
vunknown 43,142 weekly downloads native-module

Native Git bindings - C++ module

πŸ’‘ Alternative: @cloudflare/workers-github-api

Error: spawnSync /bin/sh ETIMEDOUT

normalize-url

βœ… Works
v8.1.1 29,705,104 weekly downloads utility

Normalizes URLs by removing default ports, sorting query params, resolving paths, etc.

View Example
import normalizeUrl from 'normalize-url';

// Usage:
const url = normalizeUrl('https://example.com:443//foo/../bar?c=1&a=2');
return { success: url === 'https://example.com/bar?a=2&c=1', result: url };

numeral

βœ… Works
v2.0.6 1,430,599 weekly downloads utility

Format and manipulate numbers (currency, percentages, etc.)

View Example
import numeral from 'numeral';

// Usage:
const formatted = numeral(1000).format('0,0');
const value = numeral('1,000').value();
return { success: formatted === '1,000' && value === 1000, result: { formatted, value } };

oauth

πŸ”„ Alternative Available
v0.10.2 2,991,638 weekly downloads auth

OAuth 1.0 client - use arctic (OAuth 2.0) or @cloudflare/access for Workers

πŸ’‘ Alternative: arctic or @cloudflare/access

object-assign

βœ… Works
v4.1.1 63,406,143 weekly downloads utility

Use native Object.assign() instead

View Example
import objectAssign from 'object-assign';

// Usage:
const result = objectAssign({}, { a: 1 }, { b: 2 }, { a: 3 });
return { success: result.a === 3 && result.b === 2, result };

object-hash

βœ… Works
v3.0.0 31,199,632 weekly downloads crypto

Generate consistent hashes from JavaScript objects regardless of key order. Useful for caching and deduplication.

View Example
import hash from 'object-hash';

// Key order doesn't matter
const h1 = hash({ a: 1, b: 2 });
const h2 = hash({ b: 2, a: 1 });
return { success: h1 === h2, hash: h1 };

object-path

βœ… Works
v0.11.8 1,712,555 weekly downloads utility

Access deep object properties using path strings

View Example
import objectPath from 'object-path';

// Usage:
const obj = { a: { b: { c: 1 } } };
const val = objectPath.get(obj, 'a.b.c');
objectPath.set(obj, 'a.b.d', 2);
return { success: val === 1 && obj.a.b.d === 2, result: { val, obj } };

on-finished

βœ… Works
v2.4.1 60,873,649 weekly downloads utility
View Example
import onFinished from 'on-finished';

// Usage:
const mockRes = { 
  finished: false, 
  headersSent: false,
  on: function(event, cb) { if (event === 'finish') setTimeout(cb, 0); return this; },
  once: function(event, cb) { return this.on(event, cb); },
  removeListener: function() { return this; }
};
let called = false;
onFinished(mockRes, () => { called = true; });
return { success: true, result: 'onFinished called' };

once

βœ… Works
v1.4.0 71,287,712 weekly downloads utility
View Example
import once from 'once';

// Usage:
let count = 0;
const fn = once(() => count++);
fn(); fn(); fn();
return { success: count === 1, result: count };

openapi-types

βœ… Works
v12.1.3 5,791,216 weekly downloads utility

TypeScript type definitions for OpenAPI specifications

View Example
import type { OpenAPI, OpenAPIV3 } from 'openapi-types';

// Usage:
const schema: OpenAPIV3.SchemaObject = { type: 'string' };
return { success: schema.type === 'string', result: schema };

os

βœ… Works
v0.1.2 671,400 weekly downloads polyfill

Node.js os module. Available via node:os with nodejs_compat. Returns limited info in Workers.

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

View Example
import os from 'node:os';

// Get system info
const info = {
  platform: os.platform(),
  arch: os.arch(),
  tmpdir: os.tmpdir()
};
return { success: true, info };

p-all

βœ… Works
v5.0.1 1,214,311 weekly downloads utility

Run promise-returning functions concurrently with optional concurrency limit

View Example
import pAll from 'p-all';

// Usage:
const tasks = [
  () => Promise.resolve(1),
  () => Promise.resolve(2),
  () => Promise.resolve(3)
];
const result = await pAll(tasks, { concurrency: 2 });
return { success: result.length === 3 && result[0] === 1, result };

p-limit

βœ… Works
v7.2.0 155,574,688 weekly downloads async
View Example
import pLimit from 'p-limit';

// Usage:
const limit = pLimit(2);
const results = await Promise.all([
  limit(() => Promise.resolve(1)),
  limit(() => Promise.resolve(2)),
]);
return { success: true, result: results };

p-map

βœ… Works
v7.0.4 51,680,918 weekly downloads utility

Map over promises concurrently with optional concurrency limit

View Example
import pMap from 'p-map';

// Usage:
const input = [1, 2, 3];
const mapper = x => Promise.resolve(x * 2);
const result = await pMap(input, mapper, { concurrency: 2 });
return { success: result.length === 3 && result[0] === 2, result };

p-queue

βœ… Works
v9.1.0 12,435,925 weekly downloads async
View Example
import PQueue from 'p-queue';

// Usage:
const queue = new PQueue({ concurrency: 1 });
const results = await Promise.all([
  queue.add(() => Promise.resolve(1)),
  queue.add(() => Promise.resolve(2)),
]);
return { success: true, result: results };

p-retry

βœ… Works
v7.1.1 19,113,720 weekly downloads utility

Retry failed promises with exponential backoff

View Example
import pRetry from 'p-retry';

// Usage:
let count = 0;
const run = async () => {
  count++;
  if (count < 3) throw new Error('fail');
  return 'success';
};
const result = await pRetry(run, { retries: 5 });
return { success: result === 'success' && count === 3, result: { result, count } };

p-throttle

βœ… Works
v8.1.0 2,319,738 weekly downloads utility

Throttle promise-returning/async functions. Limit concurrent executions over time.

View Example
import pThrottle from 'p-throttle';

// Usage:
const throttle = pThrottle({ limit: 2, interval: 1000 });
const throttled = throttle(async (x) => x * 2);
const result = await throttled(5);
return { success: result === 10, result: { value: result } };

pako

βœ… Works
v2.1.0 40,740,313 weekly downloads compression
View Example
import pako from 'pako';

// Usage:
const input = new TextEncoder().encode('Hello, World!');
const compressed = pako.deflate(input);
const decompressed = pako.inflate(compressed);
const output = new TextDecoder().decode(decompressed);
return { success: output === 'Hello, World!', result: output };

papaparse

βœ… Works
v5.5.3 5,425,355 weekly downloads utility
View Example
import Papa from 'papaparse';

// Usage:
const csv = 'name,age\nJohn,30\nJane,25';
const result = Papa.parse(csv, { header: true });
return { success: result.data.length === 2, result: result.data };

parse5

βœ… Works
v8.0.0 58,527,064 weekly downloads html

HTML5 parser

View Example
import { parse } from 'parse5';

// Usage:
const doc = parse('<html><body><h1>Test</h1></body></html>');
return { success: doc.nodeName === '#document', result: { nodeName: doc.nodeName } };

parseurl

βœ… Works
v1.3.3 44,452,772 weekly downloads utility
View Example
import parseurl from 'parseurl';

// Usage:
const req = { url: '/path?foo=bar' };
const parsed = parseurl(req);
return { success: parsed.pathname === '/path', result: parsed.pathname };

passport

βœ… Works
v0.7.0 4,735,813 weekly downloads other

Authentication middleware for Express. Works with httpServerHandler and express-session.

View Example
import { httpServerHandler } from 'cloudflare:node';
import express from 'express';
import session from 'express-session';
import passport from 'passport';
import { Strategy as LocalStrategy } from 'passport-local';

const app = express();
app.use(express.urlencoded({ extended: false }));
app.use(session({ secret: 'secret', resave: false, saveUninitialized: false }));
app.use(passport.initialize());
app.use(passport.session());

passport.use(new LocalStrategy((username, password, done) => {
  if (username === 'admin' && password === 'pass') return done(null, { id: 1, username });
  return done(null, false);
}));
passport.serializeUser((user, done) => done(null, user.id));
passport.deserializeUser((id, done) => done(null, { id, username: 'admin' }));

app.post('/login', passport.authenticate('local'), (req, res) => res.json({ user: req.user }));

app.listen(3000);
export default httpServerHandler({ port: 3000 });

passport-local

βœ… Works
vunknown 1,737,539 weekly downloads auth

Username/password authentication strategy for Passport. Works with Express via httpServerHandler.

πŸ’‘ Alternative: @cloudflare/access

Error: spawn npm ENOENT

View Example
import { httpServerHandler } from 'cloudflare:node';
import express from 'express';
import session from 'express-session';
import passport from 'passport';
import { Strategy as LocalStrategy } from 'passport-local';

const app = express();
app.use(express.urlencoded({ extended: false }));
app.use(session({ secret: 'secret', resave: false, saveUninitialized: false }));
app.use(passport.initialize());
app.use(passport.session());

passport.use(new LocalStrategy((username, password, done) => {
  // Verify credentials against your user store
  if (username === 'admin' && password === 'pass') {
    return done(null, { id: 1, username });
  }
  return done(null, false, { message: 'Invalid credentials' });
}));

passport.serializeUser((user, done) => done(null, user.id));
passport.deserializeUser((id, done) => done(null, { id }));

app.post('/login', passport.authenticate('local'), (req, res) => {
  res.json({ success: true, user: req.user });
});

app.listen(3000);
export default httpServerHandler({ port: 3000 });

passport-oauth

βœ… Works
v1.0.0 174,463 weekly downloads auth

OAuth 1.0 authentication strategy for Passport. Works with Express via httpServerHandler.

πŸ’‘ Alternative: arctic / @cloudflare/access

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

View Example
import { httpServerHandler } from 'cloudflare:node';
import express from 'express';
import session from 'express-session';
import passport from 'passport';
import { OAuthStrategy } from 'passport-oauth';

const app = express();
app.use(session({ secret: 'secret', resave: false, saveUninitialized: false }));
app.use(passport.initialize());
app.use(passport.session());

passport.use(new OAuthStrategy({
  requestTokenURL: 'https://api.example.com/oauth/request_token',
  accessTokenURL: 'https://api.example.com/oauth/access_token',
  userAuthorizationURL: 'https://api.example.com/oauth/authorize',
  consumerKey: process.env.OAUTH_CONSUMER_KEY,
  consumerSecret: process.env.OAUTH_CONSUMER_SECRET,
  callbackURL: 'https://myapp.com/auth/callback'
}, (token, tokenSecret, profile, done) => done(null, { token, profile })));

passport.serializeUser((user, done) => done(null, user));
passport.deserializeUser((user, done) => done(null, user));

app.get('/auth/provider', passport.authenticate('oauth'));
app.get('/auth/callback', passport.authenticate('oauth'), (req, res) => res.json({ user: req.user }));

app.listen(3000);
export default httpServerHandler({ port: 3000 });

passport-oauth2

βœ… Works
v1.8.0 1,206,906 weekly downloads auth

OAuth 2.0 authentication strategy for Passport. Works with Express via httpServerHandler.

πŸ’‘ Alternative: arctic / @cloudflare/access

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

View Example
import { httpServerHandler } from 'cloudflare:node';
import express from 'express';
import session from 'express-session';
import passport from 'passport';
import OAuth2Strategy from 'passport-oauth2';

const app = express();
app.use(session({ secret: 'secret', resave: false, saveUninitialized: false }));
app.use(passport.initialize());
app.use(passport.session());

passport.use(new OAuth2Strategy({
  authorizationURL: 'https://github.com/login/oauth/authorize',
  tokenURL: 'https://github.com/login/oauth/access_token',
  clientID: process.env.GITHUB_CLIENT_ID,
  clientSecret: process.env.GITHUB_CLIENT_SECRET,
  callbackURL: 'https://myapp.com/auth/callback'
}, (accessToken, refreshToken, profile, done) => done(null, { accessToken, profile })));

passport.serializeUser((user, done) => done(null, user));
passport.deserializeUser((user, done) => done(null, user));

app.get('/auth/github', passport.authenticate('oauth2'));
app.get('/auth/callback', passport.authenticate('oauth2'), (req, res) => res.json({ user: req.user }));

app.listen(3000);
export default httpServerHandler({ port: 3000 });

passport-strategy

βœ… Works
v1.0.0 4,474,148 weekly downloads auth

Base class for creating custom Passport authentication strategies. Works with Express via httpServerHandler.

πŸ’‘ Alternative: arctic / @cloudflare/access

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

View Example
import { httpServerHandler } from 'cloudflare:node';
import express from 'express';
import passport from 'passport';
import Strategy from 'passport-strategy';

// Custom API key strategy
class ApiKeyStrategy extends Strategy {
  constructor() { super(); this.name = 'apikey'; }
  authenticate(req) {
    const apiKey = req.headers['x-api-key'];
    if (apiKey === 'valid-key') this.success({ id: 1, name: 'API User' });
    else this.fail({ message: 'Invalid API key' }, 401);
  }
}

const app = express();
app.use(passport.initialize());
passport.use(new ApiKeyStrategy());

app.get('/api/protected', passport.authenticate('apikey', { session: false }), (req, res) => {
  res.json({ user: req.user });
});

app.listen(3000);
export default httpServerHandler({ port: 3000 });

path

βœ… Works
v0.12.7 3,558,770 weekly downloads utility

Node.js path module (polyfilled in Workers)

View Example
import path from 'path';

// Usage:
const result = {
  join: path.join('/foo', 'bar', 'baz.txt'),
  dirname: path.dirname('/foo/bar/baz.txt'),
  extname: path.extname('index.html')
};
return { success: result.join === '/foo/bar/baz.txt' && result.dirname === '/foo/bar' && result.extname === '.html', result };

path-is-absolute

βœ… Works
v2.0.0 54,167,127 weekly downloads utility

Check if path is absolute

View Example
import pathIsAbsolute from 'path-is-absolute';

// Usage:
const abs = pathIsAbsolute('/foo/bar');
const rel = pathIsAbsolute('foo/bar');
return { success: abs === true && rel === false, result: { abs, rel } };

path-to-regexp

βœ… Works
v8.3.0 103,310,855 weekly downloads utility

Path pattern matching - useful for routing in Workers

View Example
import { match } from 'path-to-regexp';

// Usage:
const matchFn = match('/user/:id');
const result = matchFn('/user/123');
return { success: result !== false && result.params.id === '123', result };

pdf-lib

βœ… Works
v1.17.1 2,493,692 weekly downloads other

PDF creation and manipulation - works in Workers!

View Example
import { PDFDocument } from 'pdf-lib';

// Usage:
const pdfDoc = await PDFDocument.create();
const page = pdfDoc.addPage([600, 400]);
page.drawText('Hello Workers!', { x: 50, y: 350, size: 30 });
const pdfBytes = await pdfDoc.save();
return { success: pdfBytes.length > 0, result: { size: pdfBytes.length } };

pdfkit

πŸ”„ Alternative Available
v0.17.2 1,407,497 weekly downloads pdf

Use @cloudflare/stream or pdf-lib for PDF generation

πŸ’‘ Alternative: pdf-lib

Error: Unexpected token ':'

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

picomatch

βœ… Works
v4.0.3 171,757,958 weekly downloads utility

Fast glob matcher used by many tools

View Example
import picomatch from 'picomatch';

// Usage:
const isMatch = picomatch('*.js');
const result = { match: isMatch('test.js'), noMatch: !isMatch('test.css') };
return { success: result.match && result.noMatch, result };

pify

βœ… Works
v6.1.0 76,144,548 weekly downloads utility

Promisify callback-based functions

View Example
import pify from 'pify';

// Usage:
const fn = (arg: string, callback: (err: null, result: string) => void) => {
  callback(null, arg.toUpperCase());
};
const promisified = pify(fn);
const result = await promisified('hello');
return { success: result === 'HELLO', result };

pino

βœ… Works
v10.1.0 15,695,955 weekly downloads logging
View Example
import pino from 'pino';

// Usage:
const logger = pino({ level: 'info' });
logger.info({ test: true }, 'Hello from pino');
return { success: true, result: 'logged' };

plist

βœ… Works
v3.1.0 4,954,375 weekly downloads parsing

Parse/build Apple plist files

View Example
import plist from 'plist';

// Usage:
const obj = { name: 'test', version: 1 };
const xml = plist.build(obj);
const parsed = plist.parse(xml);
return { success: parsed.name === 'test', result: parsed };

pluralize

βœ… Works
v8.0.0 17,484,958 weekly downloads utility

Pluralization/singularization utility

View Example
import pluralize from 'pluralize';

// Usage:
const result1 = pluralize('person'); // 'people'
const result2 = pluralize('person', 1); // 'person'
const result3 = pluralize('person', 5); // 'people'
return { 
  success: result1 === 'people' && result2 === 'person' && result3 === 'people',
  result: { result1, result2, result3 }
};

pngjs

βœ… Works
v7.0.0 15,525,219 weekly downloads image

PNG encoder/decoder

View Example
import { PNG } from 'pngjs';

// Usage:
const png = new PNG({ width: 10, height: 10 });
return { success: png.width === 10, result: { width: png.width, height: png.height } };

polished

βœ… Works
v4.3.1 7,354,206 weekly downloads utility

CSS-in-JS utility library

View Example
import { darken, lighten } from 'polished';

// Usage:
const darker = darken(0.1, '#CCCCCC');
const lighter = lighten(0.1, '#333333');
return { success: typeof darker === 'string' && typeof lighter === 'string', result: { darker, lighter } };

preact

βœ… Works
v10.28.2 9,067,506 weekly downloads ui

Lightweight React alternative, SSR works great

View Example
import { h } from 'preact';
import renderToString from 'preact-render-to-string';

// Usage:
const element = h('div', null, 'Hello, World!');
const html = renderToString(element);
return { success: html.includes('Hello, World!'), result: html };

pretty-bytes

βœ… Works
v7.1.0 17,532,840 weekly downloads utility

Convert bytes to human readable string

View Example
import prettyBytes from 'pretty-bytes';

// Usage:
const result = prettyBytes(1337);
return { success: result === '1.34 kB', result };

pretty-error

βœ… Works
v4.0.0 11,257,060 weekly downloads utility

Pretty print error stack traces with colors and formatting.

View Example
import PrettyError from 'pretty-error';

// Usage:
const pe = new PrettyError();
const err = new Error('Something went wrong');
const rendered = pe.render(err);
return { success: rendered.includes('Something went wrong'), result: { length: rendered.length } };

prettyjson

βœ… Works
v1.2.5 1,082,812 weekly downloads utility

Format JSON with colors and indentation for readable output.

πŸ’‘ Alternative: JSON.stringify(obj, null, 2)

View Example
import prettyjson from 'prettyjson';

// Usage:
const data = { name: 'test', count: 42 };
const pretty = prettyjson.render(data);
return { success: pretty.includes('name'), result: { length: pretty.length } };

promise

🏠 Built into Workers
v8.3.0 17,661,685 weekly downloads polyfill

ES6 Promise polyfill. Workers has native Promise support built-in.

πŸ’‘ Alternative: native Promise

promise-polyfill

🏠 Built into Workers
v8.3.0 3,587,379 weekly downloads polyfill

Promise polyfill - Promises are native in Workers

prop-types

βœ… Works
v15.8.1 38,331,118 weekly downloads validation

React PropTypes - runtime type checking for React components

View Example
import PropTypes from 'prop-types';

// Usage:
const stringType = PropTypes.string.isRequired;
const numberType = PropTypes.number;
const objectShape = PropTypes.shape({
  name: PropTypes.string,
  age: PropTypes.number
});
return { 
  success: typeof stringType === 'function' && typeof numberType === 'function',
  result: { hasString: !!stringType, hasNumber: !!numberType, hasShape: !!objectShape }
};

protobufjs

⚠️ Works (with notes)
v8.0.0 29,914,640 weekly downloads encoding

Protocol Buffers. Dynamic compilation fails (uses new Function). Use protobufjs/light with pre-compiled static modules from pbjs CLI.

Error: Dynamic compilation uses new Function() - pre-compile protos instead

View Example
import protobuf from 'protobufjs/light';

// Usage: Use protobufjs/light with pre-compiled protos
// Pre-compile with: pbjs -t static-module -o proto.js *.proto
const root = new protobuf.Root();
return { success: true, result: { note: 'Pre-compile .proto files with pbjs CLI' } };

proxy-addr

βœ… Works
v2.0.7 40,886,193 weekly downloads network

Parse proxy addresses from request headers

View Example
import proxyAddr from 'proxy-addr';

// Usage:
// Create mock request object
const req = {
  connection: { remoteAddress: '127.0.0.1' },
  headers: { 'x-forwarded-for': '203.0.113.195, 70.41.3.18, 150.172.238.178' }
};

// Parse proxy address with trust function
const addr = proxyAddr(req, () => true);

return { 
  success: addr === '203.0.113.195',
  result: { address: addr }
};

pull-stream

βœ… Works
v3.7.0 34,749 weekly downloads async

Minimal pull-stream implementation

View Example
import pull from 'pull-stream';

// Usage:
const result = [];
pull(
  pull.values([1, 2, 3]),
  pull.map(x => x * 2),
  pull.drain(x => result.push(x))
);
return { success: result.length === 3 && result[0] === 2, result };

pump

βœ… Works
v3.0.3 47,541,356 weekly downloads utility

Pipe streams together with proper error handling

View Example
import pump from 'pump';

// Usage:
const { Readable, Writable } = await import('node:stream');

const source = Readable.from(['hello', ' ', 'world']);
const chunks: string[] = [];
const dest = new Writable({
  write(chunk, encoding, callback) {
    chunks.push(chunk.toString());
    callback();
  }
});

await new Promise((resolve, reject) => {
  pump(source, dest, (err) => {
    if (err) reject(err);
    else resolve(undefined);
  });
});

return { 
  success: chunks.join('') === 'hello world',
  result: chunks.join('')
};

q

βœ… Works
v1.5.1 10,122,649 weekly downloads async

Promise library (use native Promises instead)

View Example
import Q from 'q';

// Usage:
const deferred = Q.defer();
setTimeout(() => deferred.resolve('hello'), 10);

const result = await deferred.promise;

return { 
  success: result === 'hello',
  result
};

qs

βœ… Works
v6.14.1 94,050,307 weekly downloads parsing
View Example
import qs from 'qs';

// Usage:
const parsed = qs.parse('a=1&b=2');
const stringified = qs.stringify({ c: 3, d: 4 });
return { success: true, result: { parsed, stringified } };

query-string

βœ… Works
v9.3.1 13,119,516 weekly downloads parsing
View Example
import queryString from 'query-string';

// Usage:
const parsed = queryString.parse('a=1&b=2');
return { success: true, result: parsed };

querystring

βœ… Works
v0.2.1 12,943,630 weekly downloads utility

Query string parsing (use URLSearchParams instead)

View Example
import querystring from 'querystring';

// Usage:
const parsed = querystring.parse('foo=bar&abc=xyz&abc=123');
const stringified = querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'] });

return { 
  success: parsed.foo === 'bar' && stringified.includes('foo=bar'),
  result: { parsed, stringified }
};

quick-lru

βœ… Works
v7.3.0 25,645,309 weekly downloads utility

Simple LRU cache implementation

View Example
import QuickLRU from 'quick-lru';

// Usage:
const lru = new QuickLRU({ maxSize: 100 });
lru.set('foo', 'bar');
lru.set('hello', 'world');

return { 
  success: lru.has('foo') && lru.get('foo') === 'bar' && lru.get('hello') === 'world',
  result: { foo: lru.get('foo'), hello: lru.get('hello'), size: lru.size }
};

raf

βœ… Works
v3.4.1 9,926,446 weekly downloads utility

requestAnimationFrame polyfill

View Example
import raf from 'raf';

// Usage:
let executed = false;
const id = raf(() => { executed = true; });

// Wait a bit for the callback to execute
await new Promise(resolve => setTimeout(resolve, 50));

return { 
  success: executed,
  result: { executed, id }
};

ramda

βœ… Works
v0.32.0 10,203,156 weekly downloads utility
View Example
import * as R from 'ramda';

// Usage:
const result = R.map(x => x * 2, [1, 2, 3]);
return { success: true, result };

randombytes

βœ… Works
v2.1.0 31,928,997 weekly downloads crypto

Crypto random bytes generation

View Example
import randomBytes from 'randombytes';

// Usage:
const bytes = randomBytes(16);
return { success: bytes.length === 16, result: { length: bytes.length } };

randomstring

βœ… Works
v1.3.1 699,241 weekly downloads utility

Random string generation

View Example
import randomstring from 'randomstring';

// Usage:
const str = randomstring.generate(10);
return { success: str.length === 10, result: { length: str.length, sample: str } };

range-parser

βœ… Works
v1.2.1 63,952,802 weekly downloads parsing

Parse HTTP Range header (used in streaming/partial content)

View Example
import rangeParser from 'range-parser';

// Usage:
const result = rangeParser(1000, 'bytes=0-499');
return { success: Array.isArray(result) && result[0].start === 0 && result[0].end === 499, result };
v9.0.1 1,422,686 weekly downloads async

Flexible rate limiter. Use memory store in Workers, or integrate with Durable Objects for distributed rate limiting.

πŸ’‘ Alternative: Durable Objects, Workers Rate Limiting API

View Example
import { RateLimiterMemory } from 'rate-limiter-flexible';

// Usage:
const limiter = new RateLimiterMemory({ points: 5, duration: 1 });
const res = await limiter.consume('user-1', 1);
return { success: res.remainingPoints === 4, result: { remaining: res.remainingPoints } };

raw-body

βœ… Works
v3.0.2 60,166,504 weekly downloads utility

Get raw body from a stream. For most cases, use native Request.text() or Request.arrayBuffer() instead.

πŸ’‘ Alternative: Request.text() or stream.text()

View Example
import getRawBody from 'raw-body';
import { Readable } from 'node:stream';

// Usage:
const stream = Readable.from(['Hello ', 'World']);
const body = await getRawBody(stream, { encoding: 'utf8' });
return { success: body === 'Hello World', result: { body } };

rc

βœ… Works
v1.2.8 38,852,704 weekly downloads utility

Configuration file loader with defaults

View Example
import rc from 'rc';

// Usage:
const config = rc('myapp', { port: 8080, host: 'localhost' });
return { success: config.port === 8080 && config.host === 'localhost', result: config };

readable-stream

🏠 Built into Workers
v4.7.0 189,297,871 weekly downloads polyfill

Node.js streams polyfill. Workers has node:stream built-in with nodejs_compat.

πŸ’‘ Alternative: node:stream

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

redux

βœ… Works
v5.0.1 16,625,100 weekly downloads utility

Redux state management - can be used in Workers

View Example
import { createStore } from 'redux';

// Usage:
const reducer = (state = 0, action) => action.type === 'INC' ? state + 1 : state;
const store = createStore(reducer);
store.dispatch({ type: 'INC' });
return { success: store.getState() === 1, result: store.getState() };

redux-logger

βœ… Works
v3.0.6 847,997 weekly downloads utility

Redux logging middleware

View Example
import { createLogger } from 'redux-logger';

// Usage:
const logger = createLogger();
return { success: typeof logger === 'function', result: { isFunction: typeof logger === 'function' } };

redux-saga

βœ… Works
v1.4.2 1,156,683 weekly downloads utility

Redux middleware for side effects

View Example
import createSagaMiddleware from 'redux-saga';

// Usage:
const sagaMiddleware = createSagaMiddleware();
return { success: typeof sagaMiddleware === 'function', result: { isFunction: typeof sagaMiddleware === 'function' } };

redux-thunk

βœ… Works
v3.1.0 9,531,914 weekly downloads utility

Redux middleware for async actions

View Example
import { thunk } from 'redux-thunk';

// Usage:
const middleware = thunk;
return { success: typeof middleware === 'function', result: { isFunction: typeof middleware === 'function' } };

reflect-metadata

βœ… Works
v0.2.2 17,648,324 weekly downloads utility

Metadata reflection API for decorators

View Example
import 'reflect-metadata';

// Usage:
const metadataKey = Symbol('test');
class Test {}
Reflect.defineMetadata(metadataKey, 'value', Test);
const result = Reflect.getMetadata(metadataKey, Test);
return { success: result === 'value', result };

regenerate

βœ… Works
v1.4.2 24,028,320 weekly downloads utility

Generate JavaScript-compatible regular expressions

View Example
import regenerate from 'regenerate';

// Usage:
const set = regenerate().addRange(0x61, 0x7A); // a-z
const result = set.toString();
return { success: result.includes('[a-z]'), result };
v0.14.1 46,380,438 weekly downloads utility

Runtime for generators/async functions (often unnecessary in modern Workers)

View Example
import 'regenerator-runtime/runtime';

// Usage:
async function* asyncGen() { yield 1; yield 2; }
const gen = asyncGen();
const result = await gen.next();
return { success: result.value === 1, result: result.value };

request

πŸ”„ Alternative Available
v2.88.2 11,621,050 weekly downloads http

request is deprecated (archived since 2020) and tries to run async operations at import time which violates Workers' global scope restrictions. Use the built-in fetch API instead, which is the modern standard for HTTP requests.

πŸ’‘ Alternative: fetch (built-in) or node:http with nodejs_compat

Error: Disallowed operation called within global scope. Asynchronous I/O (ex: fetch() or connect()), setting a timeout, and generating random values are not allowed within global scope. To fix this error, pe

request-promise

βœ… Works
v4.2.6 1,157,772 weekly downloads http

DEPRECATED but works. Promise wrapper for request. Use fetch or ky instead.

πŸ’‘ Alternative: ky

Error: No such module "node:os".

View Example
import rp from 'request-promise';

const data = await rp({ uri: 'https://api.example.com', json: true });
return { success: true, data };

request-promise-native

πŸ”„ Alternative Available
v1.0.9 2,890,093 weekly downloads http

Deprecated HTTP client - use fetch/ky/wretch

πŸ’‘ Alternative: ky

Error: Unexpected token ':'

reselect

βœ… Works
v5.1.1 14,529,055 weekly downloads utility

Memoized selectors for Redux

View Example
import { createSelector } from 'reselect';

// Usage:
const selectItems = state => state.items;
const selectTotal = createSelector(
  [selectItems],
  items => items.reduce((sum, item) => sum + item, 0)
);

const state = { items: [1, 2, 3, 4] };
const result = selectTotal(state);

return { success: result === 10, result };

resolve

⚠️ Works (with notes)
v1.22.11 114,760,557 weekly downloads utility

Node.js module resolution. isCore() works; sync/async resolve need filesystem access.

View Example
import resolve from 'resolve';

// Usage:
const fsIsCore = resolve.isCore('fs');
const fakeIsCore = resolve.isCore('nonexistent');
return { success: fsIsCore && !fakeIsCore, result: { fsIsCore, fakeIsCore } };

restify

πŸ”„ Alternative Available
v11.1.0 113,344 weekly downloads framework

Node.js HTTP framework using process.binding - use hono or itty-router for Workers

πŸ’‘ Alternative: hono

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

rfdc

βœ… Works
v1.4.1 28,028,339 weekly downloads utility

Fast deep cloning utility

View Example
import rfdc from 'rfdc';

// Usage:
const clone = rfdc();
const obj = { a: 1, b: { c: 2 } };
const cloned = clone(obj);

cloned.b.c = 3;

return { 
  success: obj.b.c === 2 && cloned.b.c === 3,
  result: { original: obj, cloned }
};

rsvp

βœ… Works
v4.8.5 4,848,049 weekly downloads utility

Promise library (native promises preferred)

View Example
import { Promise as RSVPPromise } from 'rsvp';

// Usage:
const p = new RSVPPromise((resolve) => resolve(42));
const result = await p;

return { success: result === 42, result };

rx

πŸ”„ Alternative Available
v4.1.0 1,632,664 weekly downloads async-library

Old RxJS version - use rxjs@7+

πŸ’‘ Alternative: rxjs

rxjs

βœ… Works
v7.8.2 60,141,078 weekly downloads utility

Reactive extensions for JavaScript

View Example
import { of, map } from 'rxjs';

// Usage:
const observable = of(1, 2, 3).pipe(
  map(x => x * 2)
);

let result = [];
await new Promise((resolve) => {
  observable.subscribe({
    next: value => result.push(value),
    complete: () => resolve(undefined)
  });
});

return { success: result.join(',') === '2,4,6', result };

rxjs-compat

πŸ”„ Alternative Available
v6.6.7 223,989 weekly downloads async-library

Compatibility layer for older RxJS - use rxjs@7+ directly

πŸ’‘ Alternative: rxjs

safe-buffer

βœ… Works
v5.2.1 170,430,564 weekly downloads utility

Safe Buffer API (use native Buffer)

View Example
import { Buffer } from 'safe-buffer';

// Usage:
const buf = Buffer.from('hello', 'utf8');
const result = buf.toString('base64');

return { success: result === 'aGVsbG8=', result };

sanitize-filename

βœ… Works
v1.6.3 3,076,732 weekly downloads utility
View Example
import sanitize from 'sanitize-filename';

// Usage:
const result = sanitize('hello/world.txt');
return { success: result === 'helloworld.txt', result };

sanitize-html

βœ… Works
v2.17.0 3,600,155 weekly downloads string

HTML sanitizer to prevent XSS attacks

View Example
import sanitizeHtml from 'sanitize-html';

// Usage:
const dirty = '<div><script>alert("xss")</script><p>Safe content</p></div>';
const clean = sanitizeHtml(dirty);

return { success: !clean.includes('script') && clean.includes('Safe content'), result: clean };

sax

βœ… Works
v1.4.4 42,321,887 weekly downloads parsing
View Example
import sax from 'sax';

// Usage:
const parser = sax.parser(true);
let tagName = '';
parser.onopentag = (node) => { tagName = node.name; };
parser.write('<xml>').close();
return { success: tagName === 'xml', result: tagName };

secp256k1

πŸ”„ Alternative Available
v5.0.1 2,185,269 weekly downloads crypto

Native C++ bindings - use @noble/secp256k1 for pure JS implementation

πŸ’‘ Alternative: @noble/secp256k1

semver

βœ… Works
v7.7.3 425,490,789 weekly downloads utility

Semantic version parser and comparator

View Example
import semver from 'semver';

// Usage:
const valid = semver.valid('1.2.3');
const gt = semver.gt('2.0.0', '1.0.0');
const satisfies = semver.satisfies('1.5.0', '^1.0.0');

return { success: valid === '1.2.3' && gt === true && satisfies === true, result: { valid, gt, satisfies } };

sequelize

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

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

πŸ’‘ Alternative: @cloudflare/d1

serialize-error

βœ… Works
v12.0.0 11,695,138 weekly downloads utility

Serialize Error objects to JSON-friendly format

View Example
import { serializeError } from 'serialize-error';

// Usage:
const error = new Error('Test error');
error.name = 'TestError';
const serialized = serializeError(error);

return { success: serialized.message === 'Test error' && serialized.name === 'TestError', result: serialized };

serialport

πŸ”„ Alternative Available
vunknown 155,477 weekly downloads hardware-io

SerialPort requires native C++ bindings for hardware serial port access. Not applicable to Workers.

πŸ’‘ Alternative: Workers can communicate with hardware via HTTP APIs or Workers IoT device integrations

Error: Command failed: npm install npm warn tar ENOENT: Cannot cd into '/Users/steve/works-on-workers/packages/test-harness/sandbox/serialport/node_modules/tinyspy' npm warn tar ENOENT: Cannot cd into '/User

serve-favicon

πŸ”„ Alternative Available
v2.5.1 1,727,905 weekly downloads middleware

Express middleware for serving favicon. Depends on Node.js stream internals. For favicons in Workers, use Static Assets to serve favicon.ico directly, or embed as base64 in your code.

πŸ’‘ Alternative: Workers Static Assets or embed favicon as base64

Error: no such file or directory, stat

serve-index

πŸ”„ Alternative Available
v1.9.1 12,010,335 weekly downloads middleware

Express middleware for directory listings. Depends on Node.js stream internals not fully supported in Workers. For directory listing functionality, implement custom logic with Workers Static Assets or R2.

πŸ’‘ Alternative: Workers Static Assets with custom directory listing

Error: Could not resolve emitter

serve-static

πŸ”„ Alternative Available
v2.2.1 56,338,664 weekly downloads middleware

Express/Connect middleware for serving static files. While node:fs now works in Workers, serve-static depends on Node.js stream internals that are not fully compatible. Use Workers Static Assets instead - it is the built-in, optimized solution for serving static files.

πŸ’‘ Alternative: Workers Static Assets (https://developers.cloudflare.com/workers/static-assets/)

Error: ENOENT: no such file or directory

sha1

βœ… Works
v1.1.1 623,215 weekly downloads crypto
View Example
import sha1 from 'sha1';

// Usage:
const result = sha1('hello');
return { success: result === 'aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d', result };

shallowequal

βœ… Works
v1.1.0 10,760,077 weekly downloads utility
View Example
import shallowEqual from 'shallowequal';

// Usage:
const result = shallowEqual({ a: 1, b: 2 }, { a: 1, b: 2 });
return { success: result === true, result };

sharp

πŸ”„ Alternative Available
v0.34.5 22,140,098 weekly downloads image

sharp is a native module with C++ bindings (uses libvips) that requires node:child_process and won't work in Workers. Use Cloudflare Images API for image transformations, or consider browser-based image libraries like pica or jimp for client-side processing.

πŸ’‘ Alternative: Cloudflare Images or @cloudflare/workers-image (when available)

Error: No such module "node:child_process".

shell-quote

βœ… Works
v1.8.3 32,292,117 weekly downloads utility
View Example
import { parse } from 'shell-quote';

// Usage:
const result = parse('echo "hello world"');
return { success: result.length === 2, result };

short-uuid

βœ… Works
v6.0.3 409,899 weekly downloads id-generation

Short UUID generator using base58

View Example
import shortUUID from 'short-uuid';

// Usage:
// Test the generate function
const uuid = shortUUID.generate();
const isValid = typeof uuid === 'string' && uuid.length > 0;

return { success: isValid, result: { uuid } };

shortid

πŸ”„ Alternative Available
v2.2.17 787,518 weekly downloads id-generation

Deprecated package with issues

πŸ’‘ Alternative: nanoid

Error: Cannot read properties of undefined (reading 'random')

showdown

βœ… Works
v2.1.0 954,869 weekly downloads string

Markdown to HTML converter

View Example
import { Converter } from 'showdown';

// Usage:
const converter = new Converter();
const html = converter.makeHtml('# Hello World');
return { success: html.includes('<h1') && html.includes('Hello World'), result: html };

slash

βœ… Works
v5.1.0 86,976,431 weekly downloads utility

Convert Windows backslashes to forward slashes

View Example
import slash from 'slash';

// Usage:
const result = slash('foo\\bar\\baz');
return { success: result === 'foo/bar/baz', result };

slug

βœ… Works
v11.0.1 487,129 weekly downloads string

URL slug generator

View Example
import slug from 'slug';

// Usage:
const result = slug('Hello World!');
return { success: result === 'hello-world', result };

slugify

βœ… Works
v1.6.6 6,630,287 weekly downloads string
View Example
import slugify from 'slugify';

// Usage:
const slug = slugify('Hello World!');
return { success: slug === 'Hello-World!', result: slug };

soap

βœ… Works
v1.6.2 529,805 weekly downloads networking

SOAP client for calling WSDL web services. Use namespace import: import * as soap from "soap"

View Example
import * as soap from 'soap';

// Usage:
const hasClient = typeof soap.createClientAsync === 'function';
const securityTypes = ['BasicAuthSecurity', 'BearerSecurity', 'WSSecurity'];
return { success: hasClient, result: { securityTypes, note: 'Use createClientAsync(wsdlUrl) to create SOAP client' } };

socket.io

πŸ”„ Alternative Available
v4.8.3 8,447,629 weekly downloads realtime

Use Durable Objects + WebSockets or PartyKit instead

πŸ’‘ Alternative: Durable Objects/PartyKit

socket.io-client

πŸ”„ Alternative Available
v4.8.3 6,274,819 weekly downloads network

WebSocket client - use native WebSocket or Durable Objects

πŸ’‘ Alternative: Durable Objects/PartyKit

Error: No such module "node:child_process".

source-map

βœ… Works
v0.7.6 192,069,746 weekly downloads build-tool

Library for working with source maps

View Example
import { SourceMapConsumer } from 'source-map';

// Usage:
// Test that SourceMapConsumer is available
const hasConsumer = typeof SourceMapConsumer === 'function';
return { success: hasConsumer, result: { hasConsumer } };
v0.5.21 70,378,196 weekly downloads utility

Fixes stack traces for files with source maps

View Example
import sourceMapSupport from 'source-map-support';

// Usage:
// Install source map support
sourceMapSupport.install();
return { success: true, result: 'installed' };

split

βœ… Works
v1.0.1 9,229,602 weekly downloads utility

Split text streams into line streams

View Example
import split from 'split';

// Usage:
// Split is a stream transformer
const hasSplit = typeof split === 'function';
return { success: hasSplit, result: { hasSplit } };

split2

βœ… Works
v4.2.0 33,187,204 weekly downloads utility

Split streams by newline

View Example
import split from 'split2';

// Usage:
const stream = split();
return { success: typeof stream.pipe === 'function', result: 'stream created' };

sprintf-js

βœ… Works
v1.1.3 62,109,888 weekly downloads string

String formatting library (sprintf)

View Example
import { sprintf } from 'sprintf-js';

// Usage:
const result = sprintf('Hello %s!', 'World');
return { success: result === 'Hello World!', result };

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

stack-trace

βœ… Works
v1.0.0-pre2 16,593,290 weekly downloads utility

Get V8 stack traces as structured data. Use namespace import: import * as stackTrace

View Example
import * as stackTrace from 'stack-trace';

// Usage:
const err = new Error('test');
const trace = stackTrace.parse(err);
return { success: trace.length > 0, result: { frames: trace.length } };

statuses

βœ… Works
v2.0.2 91,373,463 weekly downloads utility

HTTP status code utilities. Get status codes by message or message by code.

View Example
import statuses from 'statuses';

// Usage:
const code = statuses('OK');
const msg = statuses(404);
return { success: code === 200 && msg === 'Not Found', result: { code, msg } };

string

βœ… Works
v3.3.3 55,646 weekly downloads string

String manipulation library

View Example
import S from 'string';

// Usage:
const result = S('hello world').capitalize().s;
return { success: result === 'Hello world', result };

strip-ansi

βœ… Works
v7.1.2 313,879,414 weekly downloads string

Strip ANSI escape codes from strings

View Example
import stripAnsi from 'strip-ansi';

// Usage:
const result = stripAnsi('\u001b[31mHello\u001b[0m');
return { success: result === 'Hello', result };
v5.0.3 109,556,995 weekly downloads string

Strip comments from JSON strings. Useful for parsing JSON config files with comments.

View Example
import stripJsonComments from 'strip-json-comments';

// Usage:
const jsonWithComments = '{ "name": "test" /* comment */ }';
const clean = stripJsonComments(jsonWithComments);
const parsed = JSON.parse(clean);
return { success: parsed.name === 'test', result: parsed };

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

superjson

βœ… Works
v2.2.6 4,442,268 weekly downloads encoding

JSON serializer with support for Date, Set, Map, etc.

View Example
import superjson from 'superjson';

// Usage:
const data = { date: new Date('2026-01-10'), set: new Set([1, 2, 3]) };
const serialized = superjson.stringify(data);
const deserialized = superjson.parse(serialized);
return { success: deserialized.date instanceof Date && deserialized.set instanceof Set, result: { serialized } };

superstruct

βœ… Works
v2.0.2 2,973,804 weekly downloads validation

Data validation library

View Example
import { object, string, number } from 'superstruct';

// Usage:
const User = object({ name: string(), age: number() });
try {
  const result = User.create({ name: 'Alice', age: 30 });
  return { success: result.name === 'Alice', result };
} catch (e) {
  return { success: false, result: e.message };
}

supports-color

βœ… Works
v10.2.2 299,921,523 weekly downloads utility

Detect terminal color support

View Example
import supportsColor from 'supports-color';

// Usage:
const result = supportsColor.stdout;
return { success: true, result: { hasBasic: result !== false } };

sync-request

πŸ”„ Alternative Available
v6.1.0 708,030 weekly downloads http

Synchronous HTTP requests (blocking). Use native fetch() instead

πŸ’‘ Alternative: fetch

text-table

βœ… Works
v0.2.0 31,223,557 weekly downloads utility

Generate text tables

View Example
import table from 'text-table';

// Usage:
const t = table([['master', 'now', 'origin/master'], ['0.1.0', '4 minutes ago']]);
return { success: t.includes('master'), result: t };

throttle-debounce

βœ… Works
v5.0.2 6,137,729 weekly downloads utility

Throttle and debounce functions

View Example
import { throttle, debounce } from 'throttle-debounce';

// Usage:
const fn = () => 42;
const throttled = throttle(100, fn);
const debounced = debounce(100, fn);
return { success: typeof throttled === 'function' && typeof debounced === 'function', result: { throttled: typeof throttled, debounced: typeof debounced } };

through

βœ… Works
v2.3.8 32,036,258 weekly downloads utility

Stream transformer utility

View Example
import through from 'through';

// Usage:
// through is a stream transformer
const stream = through((data) => data);
return { success: typeof stream.write === 'function', result: { hasWrite: typeof stream.write } };

through2

βœ… Works
v4.0.2 30,449,602 weekly downloads utility

Stream transformer utility (wrapper for through)

View Example
import through2 from 'through2';

// Usage:
// through2 is a stream transformer
const stream = through2((chunk, enc, callback) => {
  callback(null, chunk);
});
return { success: typeof stream.write === 'function', result: { hasWrite: true } };

tiny-emitter

βœ… Works
v2.1.0 4,291,120 weekly downloads utility

Lightweight event emitter

View Example
import Emitter from 'tiny-emitter';

// Usage:
const emitter = new Emitter();
let called = false;
emitter.on('test', () => { called = true; });
emitter.emit('test');
return { success: called, result: { emitted: called } };

tiny-invariant

βœ… Works
v1.3.3 24,232,319 weekly downloads utility

Assertion utility

View Example
import invariant from 'tiny-invariant';

// Usage:
try {
  invariant(true, 'should not throw');
  invariant(false, 'should throw');
  return { success: false, result: 'did not throw' };
} catch (e) {
  return { success: true, result: 'threw as expected' };
}

tinycolor2

βœ… Works
v1.6.0 7,624,612 weekly downloads utility

Color manipulation library

View Example
import tinycolor from 'tinycolor2';

// Usage:
const color = tinycolor('#ff0000');
const hex = color.toHexString();
return { success: hex === '#ff0000', result: hex };

toml

βœ… Works
v3.0.0 2,448,021 weekly downloads parsing
View Example
import TOML from 'toml';

// Usage:
const obj = TOML.parse('name = "Alice"\nage = 30');
return { success: true, result: obj };

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

traverse

βœ… Works
v0.6.11 9,921,086 weekly downloads utility

Object traversal utility

View Example
import traverse from 'traverse';

// Usage:
const obj = { a: 1, b: { c: 2 } };
const result = traverse(obj).map(function(x) {
  if (typeof x === 'number') this.update(x * 2);
});
return { success: result.a === 2 && result.b.c === 4, result };

ts-essentials

βœ… Works
v10.1.1 2,990,818 weekly downloads utility

TypeScript utility types (no runtime)

View Example
// ts-essentials is type-only

// Usage:
return { success: true, result: 'ts-essentials is type-only' };

tslib

βœ… Works
v2.8.1 250,082,376 weekly downloads utility

TypeScript runtime helpers

View Example
import * as tslib from 'tslib';

// Usage:
return { success: typeof tslib.__extends === 'function', result: { hasExtends: true } };

tweetnacl

βœ… Works
v1.0.3 21,377,226 weekly downloads crypto

Cryptography library for signing, encryption, and hashing

View Example
import nacl from 'tweetnacl';

// Usage:
const pair = nacl.sign.keyPair();
const message = new Uint8Array([1, 2, 3]);
const signed = nacl.sign(message, pair.secretKey);
const opened = nacl.sign.open(signed, pair.publicKey);
return { success: opened !== null && opened.length === 3, result: 'signature verified' };

type-is

βœ… Works
v2.0.1 54,272,204 weekly downloads utility

Content-Type checking utility. Used by body-parser and Express middleware.

View Example
import typeis from 'type-is';

const isJson = typeis.is('application/json', ['json']); // 'json'
const isHtml = typeis.is('text/html', ['html']); // 'html'
return { success: isJson === 'json' };

ulid

βœ… Works
v3.0.2 3,205,805 weekly downloads id-generation
View Example
import { ulid } from 'ulid';

// Usage:
const id = ulid();
return { success: id.length === 26, result: id };

underscore

βœ… Works
v1.13.7 14,681,296 weekly downloads utility
View Example
import _ from 'underscore';

// Usage:
const result = _.flatten([[1, 2], [3, 4]]);
return { success: true, result };

underscore.string

βœ… Works
v3.3.6 2,161,906 weekly downloads utility

String manipulation utilities

View Example
import s from 'underscore.string';

// Usage:
const result = s.capitalize('hello');
return { success: result === 'Hello', result };

undici

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

Use native fetch() API in Workers

unique-random-array

πŸ”„ Alternative Available
vunknown 60,408 weekly downloads utility

Install failed - use crypto.getRandomValues()

πŸ’‘ Alternative: crypto.getRandomValues()

unist-util-visit

βœ… Works
v5.0.0 20,766,560 weekly downloads utility

AST utility for traversing unist trees

View Example
import { visit } from 'unist-util-visit';

// Usage:
const tree = { type: 'root', children: [{ type: 'text', value: 'hello' }] };
const values: string[] = [];
visit(tree, 'text', (node: any) => values.push(node.value));
return { success: values[0] === 'hello', result: values };

unleash-client

πŸ”„ Alternative Available
v6.9.0 350,269 weekly downloads feature-flags

Feature flag client - use @cloudflare/workers-sdk

πŸ’‘ Alternative: Cloudflare Workers Environment Variables or KV

unzip

πŸ”„ Alternative Available
v0.1.11 21,104 weekly downloads compression

Requires process.binding - use fflate or pako

πŸ’‘ Alternative: fflate, pako

urijs

βœ… Works
v1.19.11 3,573,805 weekly downloads utility

URI parsing and manipulation

View Example
import URI from 'urijs';

// Usage:
const uri = new URI('http://example.com/path?query=value');
return { success: uri.hostname() === 'example.com', result: { host: uri.hostname(), path: uri.path() } };

url

🏠 Built into Workers
v0.11.4 18,494,548 weekly downloads utility

Use built-in node:url module or URL global

Error: __vite_ssr_import_0__.parse is not a function

url-join

βœ… Works
v5.0.0 11,487,370 weekly downloads utility

URL path joining utility

View Example
import urljoin from 'url-join';

// Usage:
const result = urljoin('https://example.com', 'path', 'to', 'file.html');
return { success: result === 'https://example.com/path/to/file.html', result };

url-parse

βœ… Works
v1.5.10 24,635,752 weekly downloads utility

URL parsing library

View Example
import URL from 'url-parse';

// Usage:
const parsed = new URL('https://example.com/path?q=1');
return { success: parsed.hostname === 'example.com', result: { hostname: parsed.hostname } };

urllib

πŸ”„ Alternative Available
v4.9.0 403,927 weekly downloads other

HTTP client for Node.js - use fetch or ky instead

πŸ’‘ Alternative: fetch / ky

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

utf8

βœ… Works
v3.0.0 2,207,923 weekly downloads string

UTF-8 encoding/decoding

View Example
import utf8 from 'utf8';

// Usage:
const encoded = utf8.encode('hello');
const decoded = utf8.decode(encoded);
return { success: decoded === 'hello', result: { encoded, decoded } };

util

βœ… Works
v0.12.5 30,554,910 weekly downloads utility

Node.js util module

View Example
import * as util from 'util';

// Usage:
const result = util.format('Hello %s', 'World');
return { success: result === 'Hello World', result };

utils-merge

βœ… Works
v1.0.1 35,751,670 weekly downloads utility

Simple object merging utility

View Example
import merge from 'utils-merge';

// Usage:
const result = merge({ a: 1 }, { b: 2 });
return { success: result.a === 1 && result.b === 2, result };

uuid

βœ… Works
v13.0.0 167,790,604 weekly downloads id-generation
View Example
import { v4 as uuidv4, validate } from 'uuid';

// Usage:
const id = uuidv4();
const isValid = validate(id);
return { success: isValid, result: id };

valibot

βœ… Works
v1.2.0 4,646,764 weekly downloads validation
View Example
import * as v from 'valibot';

// Usage:
const schema = v.object({ name: v.string() });
const result = v.safeParse(schema, { name: 'Alice' });
return { success: result.success, result: result.output };

valid-url

βœ… Works
v1.0.9 2,564,044 weekly downloads validation

URL validation

View Example
import validUrl from 'valid-url';

// Usage:
const valid = validUrl.isUri('http://example.com');
const invalid = validUrl.isUri('not a url');
return { success: valid && !invalid, result: { valid, invalid } };
v7.0.2 21,265,898 weekly downloads utility

Validate npm package names according to npm registry rules.

View Example
import validate from 'validate-npm-package-name';

// Usage:
const valid = validate('my-package');
const invalid = validate('INVALID NAME');
return { success: valid.validForNewPackages && !invalid.validForNewPackages, result: { valid: valid.validForNewPackages, errors: invalid.errors } };

validator

βœ… Works
v13.15.26 15,499,361 weekly downloads validation

String validation library

View Example
import validator from 'validator';

// Usage:
const email = validator.isEmail('test@example.com');
const notEmail = validator.isEmail('not-an-email');
return { success: email && !notEmail, result: { email, notEmail } };

vary

βœ… Works
v1.1.2 61,206,274 weekly downloads utility

HTTP Vary header utility

View Example
import vary from 'vary';

// Usage:
// vary.append() appends field to header value
const result = vary.append('Accept', 'Accept-Encoding');
return { success: result === 'Accept, Accept-Encoding', result };

verror

βœ… Works
v1.10.1 17,577,029 weekly downloads utility

Rich error objects

View Example
import VError from 'verror';

// Usage:
const err = new VError('test error');
return { success: err.message === 'test error', result: { message: err.message } };

warning

βœ… Works
v4.0.3 10,877,759 weekly downloads utility
View Example
import warning from 'warning';

// Usage:
// warning is a dev-only warning utility
// Just check that it's a function
const result = typeof warning === 'function';
warning(true, 'This should not warn');
return { success: result, result: 'warning is callable' };

web3

πŸ”„ Alternative Available
v4.16.0 448,037 weekly downloads blockchain-library

Ethereum library

πŸ’‘ Alternative: viem or ethers

Error: No such module "Users/steve/works-on-workers/packages/test-harness/sandbox/web3/node_modules/web3-providers-ws/lib/esm/isomorphic-ws".

websocket

πŸ”„ Alternative Available
v1.0.35 905,429 weekly downloads websocket-library

WebSocket client

πŸ’‘ Alternative: WebSocket API (built-in to Workers)

Error: Unexpected token ':'

winston

πŸ”„ Alternative Available
v3.19.0 16,252,353 weekly downloads logging

winston requires node:os API which is not available in Workers. Use console.log/error for simple logging, or pino with cloudflare transport for structured logging.

πŸ’‘ Alternative: console or pino-cloudflare

Error: No such module "node:os".

xlsx

βœ… Works
v0.18.5 4,917,586 weekly downloads parsing
View Example
import * as XLSX from 'xlsx';

// Usage:
const wb = XLSX.utils.book_new();
const ws = XLSX.utils.aoa_to_sheet([['Name', 'Age'], ['Alice', 30]]);
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
const csv = XLSX.utils.sheet_to_csv(ws);
return { success: csv.includes('Alice'), result: csv };

xml2js

βœ… Works
v0.6.2 24,690,803 weekly downloads parsing
View Example
import { parseString } from 'xml2js';

// Usage:
let result: any;
parseString('<root><name>test</name></root>', (err, res) => { result = res; });
return { success: result?.root?.name?.[0] === 'test', result };

xmlbuilder

βœ… Works
v15.1.1 35,374,414 weekly downloads parsing
View Example
import builder from 'xmlbuilder';

// Usage:
const xml = builder.create('root').ele('name', 'test').end();
return { success: xml.includes('<name>test</name>'), result: xml };

xmldom

βœ… Works
v0.6.0 1,292,604 weekly downloads parsing

XML DOM parser and serializer. Parse and manipulate XML documents in Workers.

View Example
import { DOMParser, XMLSerializer } from '@xmldom/xmldom';

const parser = new DOMParser();
const doc = parser.parseFromString('<root><item>test</item></root>', 'text/xml');
const item = doc.getElementsByTagName('item')[0].textContent;
return { success: item === 'test', item };

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".

xregexp

βœ… Works
v5.1.2 2,802,532 weekly downloads utility

Extended regular expressions with Unicode support, named capture groups, and more.

View Example
import XRegExp from 'xregexp';

// Usage:
const pattern = XRegExp('(?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\d{2})');
const match = XRegExp.exec('2026-01-08', pattern);
return { success: match.groups.year === '2026', result: match.groups };

xtend

βœ… Works
v4.0.2 39,728,884 weekly downloads utility
View Example
import xtend from 'xtend';

// Usage:
const result = xtend({ a: 1 }, { b: 2 }, { c: 3 });
return { success: result.a === 1 && result.b === 2 && result.c === 3, result };

yaml

βœ… Works
v2.8.2 82,200,174 weekly downloads parsing
View Example
import YAML from 'yaml';

// Usage:
const obj = { name: 'test', age: 30 };
const str = YAML.stringify(obj);
const parsed = YAML.parse(str);
return { success: parsed.name === 'test' && parsed.age === 30, result: parsed };

yamljs

βœ… Works
v0.3.0 1,708,221 weekly downloads parsing
View Example
import YAML from 'yamljs';

// Usage:
const obj = { name: 'test', age: 30 };
const str = YAML.stringify(obj);
const parsed = YAML.parse(str);
return { success: parsed.name === 'test' && parsed.age === 30, result: parsed };

yup

βœ… Works
v1.7.1 7,907,264 weekly downloads validation
View Example
import * as yup from 'yup';

// Usage:
const schema = yup.object({ name: yup.string().required() });
const result = await schema.validate({ name: 'Alice' });
return { success: true, result };

zod

βœ… Works
v4.3.5 67,068,821 weekly downloads validation
View Example
import { z } from 'zod';

// Usage:
const schema = z.object({ name: z.string(), age: z.number() });
const result = schema.safeParse({ name: 'Alice', age: 30 });
return { success: result.success, result: result.data };

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.