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

@seedcord/utils

v0.8.8

Published

Type helpers and small functions used across seedcord

Downloads

2,966

Readme

npm node license

About

@seedcord/utils holds the small functions the rest of seedcord builds on.

Until v1.0.0, minor versions can break.

Installation

Your transport already re-exports this.

pnpm add @seedcord/utils

Numbers

| function | what it does | | --- | --- | | currentTime() | the current time in epoch seconds | | generateCode(digits) | a random numeric code with that many digits | | ordinal(n) | the number with its suffix, 1st, 22nd, 13th | | parseDuration(input) | '30m' to milliseconds. Returns null on a bare number, an unknown or uppercase unit, a fraction, or a zero result | | percentage(a, b) | a as a percentage of b, to two decimals | | round(num, precision) | rounds to that many decimal places | | roundToDenomination(num, opts?) | 1234 to "1.2K". Suffixes and precision are configurable | | timestampFromSnowflake(id) | the epoch ms encoded in the top 42 bits of a Discord snowflake | | toEpochSeconds(ms) | epoch ms to epoch seconds, the unit Discord's <t:...> markup reads |

Passing epoch ms straight into <t:...> renders a date tens of thousands of years out, so convert with toEpochSeconds first.

Strings

| function | what it does | | --- | --- | | capitalize(word) | first letter uppercase, the rest lowercase | | longestStringLength(arr) | the character count of the longest element, numbers included | | prettify(key, opts?) | camelCase, PascalCase, snake_case, or kebab-case to spaced words | | prettyDifference(before, after) | the difference as a string, prefixed with + when positive | | renderTable(data, options?) | a framed monospace table for Discord. Widths count a CJK character or an emoji as two columns, which a terminal draws square and Discord draws wide for emoji. Pass budget for one string per page | | stripAnsi(value) | strips ANSI escape sequences, for a sink that would print them raw |

Objects

| function | what it does | | --- | --- | | filterCirculars(value, opts?) | a JSON-safe clone with circular references replaced by a marker. decycle mode skips toJSON, json mode runs stringify and parse | | hasKeys(obj, keys) | a type guard over dot-notation paths. Returns true when every path exists and is non-null, and narrows the object to match | | keepDefined(source, ...keys) | copies the named keys whose values are neither undefined nor null. Omit the keys to sweep all of them |

Misc

| function | what it does | | --- | --- | | assertNever(value) | exhaustiveness guard for a switch default. Adding a union variant without a case fails to compile | | formatFilePath(path, opts?) | a path rewritten relative to the working directory, ./src/Bot.ts. Returns it unchanged outside that directory or on a runtime with no process | | fyShuffle(items) | Fisher-Yates shuffle. Returns a new array and leaves the original alone |

Node

@seedcord/utils/node is a separate entry as it reads the filesystem.

| function | what it does | | --- | --- | | isTsOrJsFile(entry) | whether a Dirent is a .ts or .js file, skipping .d.ts and .map | | traverseDirectory(dir, callback) | walks a directory, imports every .ts and .js file under it, and calls back with each module |