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 🙏

© 2025 – Pkg Stats / Ryan Hefner

big-toolbox

v1.0.0

Published

Library of common TypeScript utilities

Downloads

2

Readme

ts-toolbox

Library of common TypeScript utilities as a package. It's really a grab-bag of different functions and types that I've written over time. I wouldn't use this as a browser library, but instead is intended for use with a bundler of some sorts so that tree-shaking can be performed.

Included functionality

Arrays

  • inPlaceConcat - Concatenates arrays "in-place"
  • flattenArray - Poly-fill for Array.flat().

Functions

  • throttle - Wraps a callback and enables time-based throttling
  • debounce - Wraps a callback and enables time-based debouncing

Math

  • isInteger - Type-checks and tests if number is an integer
  • isFloat - Type-checks and tests if a number is a float (not-integer)
  • isPositive - Type-checks and tests if a number is positive
  • isNegative - Type-checks and tests if a number is negative
  • isOdd - Type-checks and tests if a number is odd
  • isEven - Type-checks and tests if a number is even
  • isMultipleOf - Type-checks and tests if a number is a multiple of another
  • positive - Type-checks and ensures a number is positive (0 inclusive)
  • negative - Type-checks and ensures a number is negative (0 exclusive)
  • clampFloat - Type-checks and clamps the range of a number
  • clampUnit - Type-checks and clamps a number between 0..1
  • clampDegree - Type-checks and clamps a number between 0..360
  • clampInteger - Type-checks and clamps the range of a number, truncating decimals.
  • clampByte - Type-checks and clamps a number between 0..255, truncating decimals.
  • clampBits - Type-checks and clamps a number between 0 and the maximum value delivered by a binary number of (2 << bits).
  • precisionRound - Rounds a number to a given level of decimal precision.
  • precisionFloor - Floors a number to a given level of decimal precision.
  • precisionCeil - Ceils a number to a given level of decimal precision.
  • precisionModulo - Modulos a number by a nother, with a given level of decimal precision.
  • wrapToPositive - Wraps positive and negative numbers to the remainder within a positive range.
  • equals - Performs floating point equivelence test within a given tolerance (precision).
  • degToRad - Converts degrees to radians
  • radToDeg - Converts radians to degrees
  • linearInterp - Linearly interpolates between 2 values given an alpha fraction (0..1)
  • inverseLinearInterp - Inteversly interpolates a value by a range, returning the alpha fraction (0..1).
  • rescale - Takes an incoming range and value, and an output range and calculates a new value at the same delta as the incoming.

Objects

  • objectNestedAssign - Recursively assigns objects to a target object.
  • objectsAreSameType - Attempts to type-check two incoming values for equivelence.
  • objectMatchesLayout - Ensures that an incoming object has the same keys as another.
  • TypedMap - A simple string-key Map type that performs type-checking on adding keys.

Random

  • randomRange - Generate a random value in a range
  • randomPositiveInteger - Generates a random positive integer within integer-bounds.
  • randomNegativeInteger - Generates a random negative integer within integer-bounds.
  • randomInteger - Generates a random integer within signed-integer bounds.
  • randomBoolean - Generates a random true/false.
  • randomAlphaNumericCharacter - Generates a single character string within [0-9 A-Z a-z].
  • randomCharacter - Generates a random ASCII character.
  • randomString - Generates a random string of given length.
  • createUID - Generates a random Base-36 string.

Constribution

Feel free to contribute new functionality to this library by issuing a PR.

License

Licensed under MIT, see LICENSE file for more information.

Author

Chris Pikul