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

@chain1/utils

v1.0.0

Published

Utility functions for chain wallet app

Readme

@chain1/stok-utils

Utility functions for STOK chain wallet app.

Installation

npm install @chain1/stok-utils
# or
yarn add @chain1/stok-utils

Usage

Format Utils

import { formatDisplayAmount, formatAmount } from '@chain1/stok-utils';

// Format Korean Won (no decimals)
formatDisplayAmount(1000000, 'krw'); // "1,000,000"

// Format USD (with decimals)
formatDisplayAmount(1000.50, 'usd'); // "1,000.50"

// Small amounts (< 1) show up to 6 decimals
formatDisplayAmount(0.000123, 'usd'); // "0.000123"

Date Utils

import { formatDate, getTodayTimeRange, isToday } from '@chain1/stok-utils';

// Format dates
formatDate('2025-01-10T12:30:00Z'); // "2025-01-10 12:30"
formatDate('2025-01-10T12:30:00Z', 'korean'); // "2025년 01월 10일 12:30"
formatDate('2025-01-10T12:30:00Z', 'short'); // "01/10 12:30"

// Get today's time range
const { startTime, endTime } = getTodayTimeRange();

// Check if date is today
isToday(new Date()); // true

API

formatDisplayAmount(amount, currency)

Formats amount with thousand separators based on currency.

  • amount (number|string): Amount to format
  • currency (string): Currency code ('krw', 'usd', 'cny', etc.)
  • Returns: Formatted string

formatDate(isoDateString, format)

Formats ISO date string to readable format.

  • isoDateString (string): ISO date string
  • format (string): Format type ('default', 'korean', 'short', 'time', 'date', 'korean-date')
  • Returns: Formatted date string

getTodayTimeRange()

Gets start and end time of today.

  • Returns: Object with { startTime, endTime } as ISO strings

isToday(date)

Checks if date is today.

  • date (string|Date): Date to check
  • Returns: Boolean

License

MIT