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

mml-route-planner-lite

v0.1.0

Published

Free-tier delivery route planner. Plan up to 20 stops per run with a local VRP solver — zero API cost. Upgrade to mml-route-planner for unlimited stops, Google Directions refinement, and EV mid-route charging.

Readme

mml-route-planner-lite

A free-tier vehicle routing problem solver for delivery fleets. Plans up to 20 stops per run using a local Clarke-Wright + 2-opt solver. No external API calls. Suitable for small dispatchers, evaluation, and proof-of-concept integrations.

For larger plans or production-grade features, see mml-route-planner.

Installation

npm install mml-route-planner-lite

Requires Node.js 18 or later.

Quick start

import { planRoutes } from "mml-route-planner-lite";

const plan = planRoutes({
  depot: { lat: 50.6856, lng: -120.2835 },
  stops: [
    { id: 1, lat: 50.65, lng: -120.35 },
    { id: 2, lat: 50.71, lng: -120.22 },
    { id: 3, lat: 50.68, lng: -120.20 },
    // up to 20 stops
  ],
  constraints: {
    maxShiftMinutes: 8 * 60,
    maxRangeKm: 400,
    maxStops: 20,
    defaultServiceTimeMin: 10,
  },
  driverCount: 2,
});

for (const route of plan.routes) {
  console.log(`${route.stopIds.length} stops, ${route.distanceKm.toFixed(1)} km`);
}

Submitting more than 20 stops throws:

mml-route-planner-lite: plan exceeds the free-tier limit of 20 stops (25 submitted).
Upgrade to mml-route-planner for unlimited capacity and additional features.

What the free tier includes

  • Clarke-Wright savings with 2-opt local search
  • Haversine distance matrix (no API calls)
  • Multi-driver bin-packing with split-largest / merge-smallest
  • Hard time windows (earliest / latest arrival per stop)
  • Priority stops and pickup-before-delivery
  • Up to 20 stops per plan run
  • Duplicate stop-id detection

What requires the full version

  • Stops beyond the 20-per-run cap
  • Google Directions refinement (real road polylines and accurate ETAs per route)
  • Mid-route EV charging via Google Places (New)
  • Commercial EV vehicle presets
  • Service-time estimator based on weight, size, package count, and address features
  • Soft time windows (lateness as a penalty instead of a hard reject)
  • Driver breaks (ELD-compliant rest windows)
  • Skills and compatibility constraints
  • Cost-based objective with fixed, per-km, and per-minute vehicle costs
  • Workload balancing
  • zod input schema, GeoJSON export, and CLI

API

planRoutes(input)

Synchronous. Returns { routes, unassigned, reasons, totalDistanceKm, totalDurationMin, stops, points }.

| Field | Required | Description | |---|---|---| | depot | yes | { lat, lng } — start and end for every route. | | stops | yes | Array of { id, lat, lng, ... }. Maximum 20. IDs must be unique. | | constraints.maxShiftMinutes | yes | Maximum drive + service minutes per driver. | | constraints.maxRangeKm | yes | Maximum route distance. | | constraints.maxStops | yes | Maximum stops per driver. | | constraints.defaultServiceTimeMin | no | Default 10. | | constraints.shiftStartMin | no | Shift start in minutes from midnight. Default 480 (8 AM). | | driverCount | no | Force K drivers. Omit to use as few as the solver naturally produces. | | matrixOptions.roadFactor | no | Haversine-to-road multiplier. Default 1.3. | | matrixOptions.avgSpeedKmh | no | Default 60. |

Per-stop optional fields: serviceTimeMin, windowEarliestMin, windowLatestMin, priority, label, pickupIdx.

getFreeTierLimit()

Returns the current stop limit (20). Useful for UI that displays "x of 20 stops remaining."

Upgrading

The full version of mml-route-planner removes the 20-stop cap and adds Google Directions refinement, mid-route EV charging, commercial vehicle presets, soft time windows, driver breaks, skills constraints, a cost-based objective, a zod input schema, GeoJSON export, and a command-line interface.

Contact github.com/deepanshh786 for access.

License

MIT. See LICENSE.