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

trellus-node-onfleet

v1.0.14

Published

Trellus Fork of Onfleet's Node.js API Wrapper Package

Readme

Trellus's Implementation of Onfleet's Node Package

Motivation

  • Fixing the rate limiter and other issues found, described below
  • Migrating to using typescript and exporting all types to avoid dependence on @types package

Issues in the Original Package:

See Node Onfleet Package

  • The Onfleet constructor takes bottleneckOptions, but never sets them on the rate limiter.
  • The bottleneckOptions are never validated.
  • Rate limiter is being passed a parameter "waitUponDepletion" which is not a valid Bottleneck parameter.
  • Errors being made with "new ErrorType" when all "ErrorType" are functions, not classes, which leads to the thrown error actually being about how "ErrorType" is not a constructor rather than the intended error.
  • Rate limiter reservoir never gets refreshed if hitting the rate limit exactly, causing all requests to wait forever until library user's the application is restarted.
    • Actually hitting the rate limit is an error response which causes the method to throw. Given a function that makes request calls and only try/catches the entire loop, the throwing of an error will stop the requests from being added to the limiter, such that the limiter's reservoir has a high chance of getting depleted when the queue is empty. This does not trigger a reserver reset due to the empty conditional in the depleted event handler.
  • Having the reservoir update after each request doesn't work properly.
    • If multiple requests are made, the first one to come back will increase the reservoir, allowing more requests while the subsequent requests are still pending.

Improvements This Package Makes:

  • Rate limiter now functions as expected
  • Rate limiter options are simplified to maxConcurrent and minTime, and are now validated and properly set
  • Significantly more tests surrounding rate limiting
  • Testing migrated to Vitest from Chai/Mocha
  • Typescript migration
  • Resources properly typed, each exports relevant types
  • Updated existing resources to align with the latest Postman collection and API docs as of May 2025
    • Adds missing workers.getTasks
    • Fixes wrong type on workers.setSchedule
    • Adds missing recipients.findByName and .findByPhone
  • Added Route Plan resource, basic tests included
  • Added Route Optimization resource, basic tests included
  • Fix issue with custom error creation
  • Lots of documentation via JSDoc / comments