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

stonev5-utils

v1.2.0

Published

TypeScript utility library (browser flavor): string, time, array, object, pinyin, md5, id, parallel, dom, clipboard and more

Readme

stonev5-utils

npm npm downloads CI Publish License: ISC

English | 简体中文

A personal collection of TypeScript utility functions (browser flavor) — pure functions, import from the package root or per module for tree-shaking (sideEffects: false). Source lives in src/, all TypeScript.

Install

npm i stonev5-utils

All exports are available from the package root. Three modules are thin wrappers around third-party libraries — their dependencies (ts-md5 / pinyin-pro / uuid) are declared as regular dependencies and install automatically, no manual setup needed:

| Module | Wraps | Usage | | ------ | ----- | ----- | | md5 | ts-md5 | import { getMd5 } from "stonev5-utils" | | pinyin | pinyin-pro | import { getPinyin } from "stonev5-utils" | | id | uuid | import { newID } from "stonev5-utils" |

Module overview

All modules re-export from the root entry (import { newID } from "stonev5-utils"). Subpath imports like stonev5-utils/lib/time are also supported for finer tree-shaking control.

| Module | Description | | ------ | ----------- | | lib/array | Null-safe push family (pushUniq / pushReplaceBy / removeFromArr…), range generation | | lib/clipboard | copy2clipboard: write text to the system clipboard | | lib/cmd | runCmd: run shell commands asynchronously | | lib/desktop | osFs / osPath: desktop (SiYuan Note) filesystem & path adapters | | lib/dom | HTML-to-div, zero-width character cleanup and other DOM utilities | | lib/file | tempFile: write temporary files | | lib/functional | into / objectToMap and other functional helpers | | lib/global | getGlobal / setGlobal: global key-value storage | | lib/id | newID: UUID-based unique IDs | | lib/md5 | getMd5: MD5 hash | | lib/object | set / clone / RefObj / newProxy, type guards and numeric validation | | lib/parallel | pmap family of concurrent map helpers (failures become null, never abort the batch) | | lib/pinyin | getPinyin / pinyinLongShort: Chinese-to-pinyin conversion | | lib/rand | Random numbers | | lib/string | replaceAll / htmlEscape / toJSON / splitByMiddle etc. | | lib/time | formatDate / getDayStr / sleep / readableDuration etc. |

Quick start

import { newID, getMd5, getPinyin, formatDate, sleep, pmap } from "stonev5-utils";

const id = newID();                    // uuid
const hash = getMd5("hello");          // md5
const py = getPinyin("中文标题");       // pinyin
const now = formatDate(0);             // current date & time
await sleep(1000);

// Concurrent map: individual failures are skipped, nothing throws
// (use pmapNull if you want nulls kept in the result)
const results = await pmap(urls, (u) => fetch(u).then((r) => r.text()));

For the Node.js flavor see node-package/ (formerly published as stonev5-utils-node; that package name has been reclaimed and it is not currently republished).

Development

npm test        # jest
npm run build   # tsc compile to lib/

Publishing (automated via GitHub Actions)

Publishing runs entirely on GitHub's infrastructure — no local npm login needed:

  1. Configure Trusted Publishing once on npmjs.com, pointing at this repo's .github/workflows/publish.yml;
  2. After your changes:
npm version patch            # bump version, create commit + v* tag
git push && git push --tags  # pushing the tag triggers the release

CI verifies tag/version match → runs tests → builds → publishes to npm via OIDC trusted publishing (provenance included automatically), no token required.