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

routing-wasm

v2.2.0

Published

Google OR-Tools Routing for JavaScript and TypeScript, with browser and Node WASM runtimes.

Readme

OR-Tools Routing for JavaScript

npm: routing-wasm npm: or-tools-wasm GitHub

Install:

npm install routing-wasm

Main repository · Documentation · Full library on npm · Google OR-Tools

Same API. Fast solves on any device.

Sign up for the hosted cloud version.

  • Route optimization and fleet planning: build last-mile delivery planners, courier dispatch tools, and field-service schedules. Solve traveling salesman (TSP) and vehicle routing (VRP) problems.
  • Capacity and delivery windows: solve capacitated vehicle routing (CVRP) and vehicle routing with time windows (VRPTW). Optimize travel distance or cost while respecting vehicle capacities, pickups and deliveries, and driver breaks.
  • TypeScript and JavaScript: define travel costs with callbacks, inspect routes and schedules, and reuse assignments to reoptimize routes.
  • Browser and server: run multithreaded WebAssembly locally in browsers, Node.js, Deno, or Bun without sending your model data to a server. Use a native server when you want remote execution through the same API.

Native Google OR-Tools Routing, directly in JavaScript. No Python service required. The same API as or-tools-wasm/routing, in a smaller standalone package.

Examples

Click the image to try delivery routing.

Installation

npm install routing-wasm

The package includes TypeScript declarations and Routing's native solver dependencies. No separate CP-SAT package is required.

Quick start

import { RoutingIndexManager, RoutingModel } from 'routing-wasm';

const distances = [[0, 2, 3], [2, 0, 1], [3, 1, 0]];
const manager = new RoutingIndexManager(3, 1, 0);
const routing = new RoutingModel(manager);
const transit = routing.registerTransitCallback((from, to) =>
  distances[manager.indexToNode(from)][manager.indexToNode(to)]);
routing.setArcCostEvaluatorOfAllVehicles(transit);
const result = await routing.solve({ executor: 'worker' });
console.log(result);

Execution

Use executor: 'direct' for in-process execution, or executor: { type: 'server', url: 'http://localhost:17827' } for an OR-Tools solver server. Server solves do not load local WASM.

Worker execution keeps solving off the application's main thread.

In Node.js, executor: 'direct' can block the event loop during a solve, even when awaited. Timers and timer-driven cancellation cannot run while it is blocked. Use executor: 'worker' when your application needs to stay responsive or cancel a solve from a timer.

The runtime uses JSPI when supported and automatically falls back to Asyncify when JSPI is unavailable. Both runtimes are included in the package. Only the selected runtime is loaded.

When shutting down a Node application after direct execution, call terminateLoadedRuntimeThreads() to release retained runtime threads.

The existing or-tools-wasm/routing import remains supported. Choose either distribution; installing both duplicates runtime assets. Model objects should be used with the API that created them.

Compatibility

routing-wasm runs in Chromium browsers and Firefox, and in Node.js, Deno, and Bun. Browsers can run single-threaded without headers; see setup. JSPI and Asyncify runtimes are selected automatically.

Supported bundlers include Vite, Webpack, and Rollup. The same API also supports execution on a native C++ OR-Tools solver server.

Reference and examples