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

@drzioner/helpers

v0.4.0

Published

Zero-dependency TypeScript utility library for dates, math, files, and strings

Readme

@drzioner/helpers

CI npm version License: MIT

Zero-dependency TypeScript utility library for dates, math, files, and strings.

Requirements

  • Node.js >= 18

Installation

pnpm add @drzioner/helpers
# or
npm install @drzioner/helpers

Modules

Database

import { generateUID } from '@drzioner/helpers';

const uid = generateUID();
// "16478271-33403a97-d811b91d-345c8543-334d9a74-5044d5a47"

Dates

import { manipulateDate, dateDifference, formatDate, CustomFormat } from '@drzioner/helpers';

const date = manipulateDate({ days: -1, months: 1 }, '2022-04-09');
// 2022-05-08T00:00:00.000Z

const diff = dateDifference('2021-04-09', '2021-04-01', 'days');
// 8

const formatted = formatDate('custom', new Date(), CustomFormat.YYYY_MM_DD);
// "2024-06-15"

Files

import { randomFileName, createFile } from '@drzioner/helpers';

const name = randomFileName('photo.jpg');
// "1647828249206a64bdc57f939d47eae0...jpg"

await createFile('data.json', '{"key": "value"}', './output');

Math

import { arithmeticOperations, sum } from '@drzioner/helpers';

arithmeticOperations([2, 1, 4, 3], 'sum'); // 10
sum(3, 4);                                  // 7

Strings

import { padNumber } from '@drzioner/helpers';

padNumber(1);            // "0001"
padNumber(1, 2);         // "01"
padNumber(1, 5, 'z');    // "zzzz1"

API Reference

Database

| Function | Description | |----------|-------------| | generateUID() | Generate a unique identifier string |

Dates

| Function | Description | |----------|-------------| | dateDifference(first, second, unit?) | Absolute difference between two dates | | differenceTodayAndAnotherDate(date, unit?) | Difference between today and a date | | formatDate(type, date?, format?) | Format a date as string | | getDate(date?) | Parse to Date object | | getYear(date?) / getYearUTC(date?) | Get year (local/UTC) | | getMonth(date?) / getMonthUTC(date?) | Get month (local/UTC) | | getDay(date?) / getDayUTC(date?) | Get day (local/UTC) | | getHours(date?) / getHoursUTC(date?) | Get hours (local/UTC) | | getMinutes(date?) / getMinutesUTC(date?) | Get minutes (local/UTC) | | getSeconds(date?) / getSecondsUTC(date?) | Get seconds (local/UTC) | | getMilliseconds(date?) / getMillisecondsUTC(date?) | Get milliseconds (local/UTC) | | manipulateDate(options, date?) | Modify multiple date components at once | | manipulateYears(value, date?) | Add/subtract years (local) | | manipulateMonths(value, date?) | Add/subtract months (local) | | manipulateDays(value, date?) | Add/subtract days (local) | | manipulateHours(value, date?) | Add/subtract hours (local) | | manipulateMinutes(value, date?) | Add/subtract minutes (local) | | manipulateSeconds(value, date?) | Add/subtract seconds (local) | | manipulateMilliseconds(value, date?) | Add/subtract milliseconds (local) |

UTC variants exist for all manipulators (manipulateYearsUTC, etc.).

Files

| Function | Description | |----------|-------------| | randomFileName(originalName, length?, extension?, encoding?) | Generate unique file name | | createFile(file, data, path?) | Write file with path traversal protection |

Math

| Function | Description | |----------|-------------| | arithmeticOperations(values, operation) | Reduce array with arithmetic operation | | sum(a, b) | Add two numbers | | subtraction(a, b) | Subtract second from first | | multiplication(a, b) | Multiply two numbers | | division(a, b) | Divide first by second |

Strings

| Function | Description | |----------|-------------| | padNumber(value, length?, fill?) | Pad a number with fill characters |

Development

pnpm test              # Run tests
pnpm test:coverage     # Tests with coverage
pnpm build             # Build ESM + CJS
pnpm lint              # Lint with Biome
pnpm typecheck         # TypeScript type checking
pnpm validate          # Build + publint + attw

See CONTRIBUTING.md for the full development guide.

License

MIT