npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

or-tools-wasm

v0.9.1

Published

Google OR-Tools compiled to WebAssembly for TypeScript, JavaScript, browser and Node. Supports CP-SAT, Routing, MIP, MathOpt, vehicle routing, scheduling, linear programming and constraint optimization.

Readme

Google OR-Tools for Web

Solve complex optimization models from TypeScript with Google OR-Tools running as multithreaded WebAssembly.

GitHub npm

Package Vite 7 dev Chromium Vite 7 dev Firefox Vite 7 static Chromium Vite 7 static Firefox Webpack 5 dev Chromium Webpack 5 dev Firefox Webpack 5 static Chromium Webpack 5 static Firefox Rollup 4 static Chromium Rollup 4 static Firefox Node 24.12.0 Deno 2.8.1 Bun 1.3.14

Try online in your browser

Used in PragmaPlanner

Usage

Run the local test site:

npm --prefix package install
npm --prefix package run dev

Install from npm:

npm install or-tools-wasm

[!WARNING] Browser builds require cross-origin isolation headers for WebAssembly threads. See Browser requirements below.

Public solver APIs live under solver-scoped subpaths:

import { CpModel, CpSolver } from 'or-tools-wasm/cp-sat';
import { RoutingIndexManager, RoutingModel } from 'or-tools-wasm/routing';
import { MPSolver } from 'or-tools-wasm/mp-solver';
import { MathOpt } from 'or-tools-wasm/mathopt';
import { Pdlp } from 'or-tools-wasm/pdlp';
import { KnapsackSolver } from 'or-tools-wasm/knapsack';
import { SimpleMaxFlow } from 'or-tools-wasm/network-flow';
import { SetCoverModel } from 'or-tools-wasm/set-cover';
import { RcpspModelBuilder } from 'or-tools-wasm/rcpsp';

Build a CP-SAT model and solve it:

const model = new CpModel();

const desks = model.newIntVar(0, 4, 'desks');
const tables = model.newIntVar(0, 3, 'tables');

model.addLinearConstraint(desks.times(3).plus(tables.times(4)), 0, 12);
model.maximize(desks.times(20).plus(tables.times(30)));

const solver = new CpSolver();
const status = await solver.solve(model, { numSearchWorkers: 1 });

console.log(solver.statusName(status));
console.log({
  desks: solver.value(desks),
  tables: solver.value(tables),
  profit: solver.objectiveValue(),
});

API reference

See docs/api.md for the full TypeScript API reference.

Benchmarking

See benchmarking/.

Supported OR-Tools surface

| OR-Tools surface | or-tools-wasm | Description | | --- | --- | --- | | CP-SAT | ✅ | Constraint and integer optimization for Boolean, integer, scheduling, and logical models. | | Routing | ✅ | Vehicle routing (VRP), TSP, pickup-delivery, capacity, dimension, and time-window search. | | MPSolver API | ✅ | Linear and mixed-integer programming wrapper; this package includes GLOP LP, CLP LP, GLPK LP/MIP, SCIP MIP, CBC MIP, BOP MIP, Knapsack MIP, and SAT MIP backends. | | MathOpt API | ✅ | Unified modeling and solve API with incremental solving and callback support; this package includes GLOP, GLPK, GSCIP, CP-SAT, and PDLP backends. | | GLOP | ✅ | Google's simplex linear programming solver. | | PDLP | ✅ | First-order LP and convex diagonal quadratic solver for very large models. | | SAT integer programming | ✅ | CP-SAT-backed integer programming backend for pure integer linear models. | | CLP | ✅ | COIN-OR linear programming backend. | | GLPK | ✅ | GNU linear and mixed-integer programming backend. | | SCIP / GSCIP | ✅ | SCIP-based mixed-integer backend through MPSolver and MathOpt. | | CBC | ✅ | COIN-OR branch-and-cut mixed-integer programming backend through MPSolver. | | BOP | ✅ | Boolean/integer optimization backend through MPSolver. | | Knapsack | ✅ | Dedicated 0-1 and multi-dimensional knapsack solver, plus the MPSolver Knapsack backend. | | Network flow algorithms | ✅ | Dedicated max-flow, min-cost-flow, and linear-sum assignment graph algorithms. | | Assignment algorithms | ✅ | Linear-sum assignment through the dedicated Network Flow API. | | Set cover | ✅ | Dedicated weighted set cover model, invariant, and heuristic search API. | | RCPSP | ✅ | CP-SAT-backed resource-constrained project scheduling model, parser, and visual scheduling surface. | | Linear Solver ModelBuilder | | Ergonomic LP/MIP modeling API with import/export helpers and backend solve helpers. |

Unchecked rows are planned OR-Tools targets that are not exposed by this package yet. Commercial and large third-party native backends such as Gurobi, CPLEX, XPRESS, HiGHS, OSQP, ECOS, and SCS are not planned.

The TypeScript API mirrors the public OR-Tools Python API shape where it maps cleanly to WebAssembly, and the fixture suite tracks Python API behavior for the exposed solver surfaces. CP-SAT exposes both a high-level builder and the proto-first CpSat API, routing exposes the familiar RoutingIndexManager and RoutingModel APIs, MPSolver exposes the pywraplp-style solver API, and MathOpt exposes a TypeScript model builder.

The worker script and WebAssembly files are emitted automatically from package imports, with no manual copying into public/ or static/ required.

Fixture test matrix

Run the full fixture matrix:

npm --prefix package run test:fixtures

This runs the shared solver cases through Vite, Webpack, Rollup, Deno, Node, and Bun. Browser fixtures cover dev and static serving where the bundler supports both, Chromium and Firefox, direct runtime execution, the browser worker bridge, and solver thread settings where supported.

For focused iteration:

npm --prefix package run test:fixtures:browser
npm --prefix package run test:fixtures:runtime
npm --prefix package run test:fixture:node

Run the full matrix before landing solver API, worker bridge, threading, or packaging changes.

Browser requirements

Browser builds use WebAssembly threads, so pages must be served with cross-origin isolation enabled:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

Without these headers, solving can fail during WebAssembly runtime or worker startup.

See Bundler configuration for Vite, Webpack, and Rollup setup.

Bundler configuration

See docs/bundlers.md for Vite, Webpack, and Rollup setup.

Node, Deno, and Bun

Node and Bun work with normal ESM imports and do not need browser cross-origin-isolation headers.

Deno needs permissions to read package assets and inspect CPU count:

deno run --allow-read --allow-sys=cpus your-script.ts

Node uses the JSPI runtime when WebAssembly.promising is available and falls back to Asyncify otherwise. Deno and Bun use the package's Asyncify runtime path.

Upstream OR-Tools

This repository vendors Google OR-Tools and adds a JavaScript/WebAssembly packaging layer on top. OR-Tools is Google's open-source suite for solving combinatorial optimization problems, including CP-SAT, linear programming, routing, bin packing, and graph algorithms.

Upstream project:

Maintainer

Maintained by Axel Wickman.

License

This project is licensed under the Apache License 2.0. See LICENSE.