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

kyrutils

v3.0.1

Published

This library contains a number of "utility" functions used in KYR projects. Please feel free to use!

Downloads

274

Readme

KYR Utils

This library contains a number of "utility" functions used in KYR projects. Please feel free to use!

buildTar()

This builder function is used to walk optional project directories, collecting files into a .tar.zst archive.

Use the TarBuildOptions class in your build script to control config. Some of the preset directory options have filters in place, there's also room for additional directories to be walked indiscriminately.

FILTERS
The 'overrideEnv' directory walker will grab .env config files from the root of the project.
The 'distDir' directory walker will collect everything indiscriminately.
The 'dataDir' directory walker will filter any ( .yml | .yaml | .json | .xml | .ini | .csv ) files.
The 'prismaDir' directory walker will collect everything indiscriminately.
The 'webServerDir' directory walker will ignore any files ending with `*.ts` to collect all templates, static resources etc.
The 'additionalDirs' directory walker will collect everything indiscriminately from the list of dir's provided.

BuildTarOptions

This object is built and then passed as an argument to the buildTar() function.

export type TarBuildOptions = {
  overrideEnv: boolean;
  distDir?: string;
  dataDir?: string;
  prismaDir?: string;
  webServerDir?: string;
  additionalDirs?: string[];
};

Tar(Zst)Builder - Project Structure

Loose suggested structure to use the buildTar() utility for rapid server deployment via a .tar.zst archive.

STRUCTURE
projectRoot:                    ./
projectRoot/.env ->             .env config files. 
prjectRoot/dist ->              Compiled/bundled files
projectRoot/data ->             Static datafiles for apps (YAML / JSON etc.)
projectRoot/prisma ->           Static prisma files for ORM usage (schema etc.)
projectRoot/src ->              Local deploy script (imports tarBuild() and compiles to `./dist`) & project TS files
projectRoot/webServer ->        Webserver.ts files, /views directory, /static directory

getRandUUID()

Return a UUID from the Crypto library

sleep()

Wait a defined number of seconds

minutesElapsed()

Return a boolean from a Date object (time to judge from), and a number (number of minutes to check as passed since the Date object)

hoursElapsed()

Return a boolean from a Date object (time to judge from), and a number (number of hours to check as passed since the Date object)

shuffleArray()

Shuffle an Array using the Fisher-Yates algorithm

chooseRandomFromArray()

Select a random element from an Array

dateTimeUIString()

Return a UI-friendly date-stamp ("en-gb") from a String | Number | Date

dateTimeFSString()

Return a filesystem-friendly date-stamp ("en-gb") from a String | Number | Date

LATEST UPDATE

V3.0.0 - I've removed the fixed dir options for dist and made this optional like the others. You can now use this for partial deployments as well as full applications. I've also updated the function and object notes so they are clearer.

PREVIOUS VERSION NOTES

kyrUtils v1.0.0

  • Project Tar Building working for S.C.a.R.S and CM

kyrUtils v1.1.0

  • Update to grab project file (package & package-lock)

kyrUtils v1.2.0

  • Added additional Dir's list option

kyrUtilsInternal v1.3.0

  • Changed name to kyrUtilsInternal to allow public repo

kyrUtils v2.0.0

  • Changed name back
  • Corrected structure
  • Added tsdown for packaging public libraries
  • Commented all exported functions
  • Moved to "entrypoint" file structure
  • Cleaned dependencies
  • Added env override option to tar builder

kyrUtils v2.0.0

  • Package.json update

kyrUtils v2.0.1

  • Readme update

kyrUtils v2.0.2

  • Fixed import and require definitions
  • Function names updated
  • Function descriptions updated
  • Readme updated

kyrUtils v2.0.3

  • Readme updated

kyrUtils v2.0.4

  • Readme updated

kyrUtils v2.0.5

  • Function names updated
  • Function descriptions updated

kyrUtils v2.0.6

  • Internal package manager changed to PNPM
  • Removed async from date functions
  • Removed async from tarBuild (refactored async compression function)
  • Added PNPM compatibility to buildTar filters (pnpm-lock.yaml & pnpm-workspace.yaml)

kyrUtils v2.0.7

  • Added support for new Prisma versions 7.x

kyrUtils v2.0.8

  • Bug fix for Prisma versions 7.x (Grabbing prisma.config.ts) from project root
  • Version notes added to readme

kyrUtils v2.0.9

  • /prisma now collected indiscriminately

kyrUtils v2.1.0

  • Removed projFiles collection (move package files to dist through your script!)

kyrUtils v2.1.1

  • Fix an issue with files in dataDir being filtered out incorrectly

kyrUtils v3.0.0

  • Dist folder now optional and dir adjustable
  • allows custom/part deployment scripts

kyrUtils v3.0.1

  • adjusted the collection for additional dirs to preserve parent folder provided in path when building the archive