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

@blofin/helper

v0.2.2

Published

A TypeScript utility library with modular architecture

Readme

@blofin/helper

A TypeScript utility library with modular architecture.

Features

  • 📦 Modular Architecture: Organized by domain modules
  • 🎯 Tree-shaking Support: Import only what you need
  • 📚 TypeScript: Full type safety
  • 🧪 Jest Testing: Comprehensive test coverage
  • 📖 Storybook: Interactive documentation

Installation

pnpm add @blofin/helper
# or
npm install @blofin/helper
# or
yarn add @blofin/helper

Modules

calc

Calculation module using bignumber.js

import { add, subtract, multiply, divide, num } from '@blofin/helper/calc';

add(1, 2); // '3'
add(1, 2, 3, 4); // '10'
subtract(5, 3); // '2'
multiply(2, 3, 4); // '24'
divide(10, 2); // '5'
num('123.456'); // BigNumber instance

format

Formatting utilities

import { 
  formatNumber, 
  displayNumber, 
  useCurrency, 
  usePercent,
  compositeDisplayNumber,
  withCurrency,
  withThousand
} from '@blofin/helper/format';

// Core number formatting (returns number)
formatNumber(123.456, 2); // 123.46

// Display formatting (returns string)
displayNumber(1234.56, { currency: { symbol: '$' }, thousands: { enabled: true } }); 
// '$1,234.56'

// Quick entry functions
useCurrency(1234.56, '$'); // '$1,234.56'
usePercent(0.1234); // '12.34%'

// Composite display with function composition
compositeDisplayNumber(1123.133, useCurrency, withThousand()); 
// '$1,123.13'

storage

LocalStorage and SessionStorage utilities

import { 
  getLocalStorage, 
  setLocalStorage, 
  removeLocalStorage,
  getSessionStorage,
  setSessionStorage
} from '@blofin/helper/storage';

setLocalStorage('key', 'value');
const value = getLocalStorage('key'); // 'value'
removeLocalStorage('key');

setSessionStorage('sessionKey', 'sessionValue');
const sessionValue = getSessionStorage('sessionKey');

utils

General utility functions

import { isEmpty, deepClone } from '@blofin/helper/utils';

isEmpty(null); // true
isEmpty(''); // true
isEmpty([]); // true
isEmpty({}); // true
deepClone({ a: 1, b: { c: 2 } }); // { a: 1, b: { c: 2 } }

fp

Functional programming utilities

import { compose, pipe, curry, memoize, awaitEither } from '@blofin/helper/fp';

// Compose functions (right to left)
const add = (x: number) => x + 1;
const multiply = (x: number) => x * 2;
const composed = compose(multiply, add);
composed(5); // 12 (5+1 then *2)

// Pipe functions (left to right)
const piped = pipe(add, multiply);
piped(5); // 12 (5+1 then *2)

// Curry
const addCurried = curry((a: number, b: number) => a + b);
addCurried(1)(2); // 3

// Memoize
const expensiveFn = memoize((n: number) => n * n);
expensiveFn(5); // 25 (computed)
expensiveFn(5); // 25 (cached)

ui

UI components (React)

import { Countdown } from '@blofin/helper/ui';

<Countdown target={Date.now() + 60000} />

Usage

Full Import

import * as helper from '@blofin/helper';

helper.calc.add(1, 2); // '3'
helper.format.displayNumber(1234.56, { currency: { symbol: '$' } }); // '$1,234.56'
helper.utils.isEmpty(null); // true
helper.storage.setLocalStorage('key', 'value');

Module Import (Recommended)

import { add, multiply } from '@blofin/helper/calc';
import { displayNumber, useCurrency } from '@blofin/helper/format';
import { isEmpty, deepClone } from '@blofin/helper/utils';
import { compose, pipe } from '@blofin/helper/fp';

This approach enables tree-shaking, so only the imported modules will be bundled.

Development

Setup

pnpm install

Build

pnpm run build

Test

pnpm test
pnpm run test:watch
pnpm run test:coverage

Storybook

pnpm run storybook

Visit http://localhost:6006 to view the documentation.

Build Storybook

pnpm run build-storybook

Project Structure

blofin-helper/
├── src/
│   ├── calc/          # Calculation module
│   ├── format/      # Formatting module
│   ├── storage/       # Storage module
│   ├── utils/         # Utility functions
│   ├── fp/            # Functional programming
│   ├── ui/            # UI components
│   └── index.ts       # Main entry point
├── tests/             # Test files
├── stories/           # Storybook stories
├── dist/              # Build output
└── .storybook/        # Storybook configuration

License

MIT