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

uno-js

v3.127.29

Published

JS/TS common used functions, zero dependencies

Readme

npm version

uno-js

Unosquare Typescript/JavaScript Library, zero dependencies.

String, array, and Date manipulation, easy-to-use fetch controller, and more, written in Typescript.

Installation (npm)

To install uno-js through npm, you only need to run the following command:

    npm install uno-js --save

Check the documentation of this library at https://unosquare.github.io/uno/uno-js.

🚨 Deprecated Functions - Native API Replacements

Many functions in this library can be replaced by modern browser native APIs. Below are the recommended native alternatives:

✅ Fully Replaceable

abortController.ts

Status: ❌ DEPRECATED

// ❌ uno-js
import { getAbortController } from 'uno-js';
const controller = getAbortController();

// ✅ Native API (available since 2017)
const controller = new AbortController();

removeDuplicated.ts

Status: ❌ DEPRECATED

// ❌ uno-js
import { removeDuplicated } from 'uno-js';
const unique = removeDuplicated(array, 'id');

// ✅ Native API with filtering
const unique = array.filter((item, index, arr) => 
  arr.findIndex(x => x.id === item.id) === index
);

// ✅ Or using Set for primitives
const unique = [...new Set(array)];

toTitleCase.ts

Status: ❌ DEPRECATED

// ❌ uno-js
import { toTitleCase } from 'uno-js';
const title = toTitleCase('hello world');

// ✅ Native CSS
.title-case { text-transform: capitalize; }

// ✅ Or with simple regex
const title = text.toLowerCase().replace(/\b\w/g, l => l.toUpperCase());

withEnter.ts (Keyboard events)

Status: ❌ DEPRECATED

// ❌ uno-js
import { onEnterKey } from 'uno-js';
element.addEventListener('keydown', onEnterKey(callback));

// ✅ Modern Native API
element.addEventListener('keydown', (e) => {
  if (e.key === 'Enter') callback(); // More semantic than keyCode
});

SimpleObservable.ts

Status: ❌ DEPRECATED

// ❌ uno-js
import { SimpleObservable } from 'uno-js';
const obs = new SimpleObservable();

// ✅ Native API - EventTarget
class SimpleObservable extends EventTarget {
  inform(data) { this.dispatchEvent(new CustomEvent('change', { detail: data })); }
  subscribe(callback) { 
    this.addEventListener('change', callback);
    return () => this.removeEventListener('change', callback);
  }
}

⚠️ Partially Replaceable

formatter.ts (Number and date formatting)

Status: ⚠️ PARTIALLY DEPRECATED

// ❌ uno-js money formatting
import { toMoney } from 'uno-js';
const formatted = toMoney(1234.56);

// ✅ Native API - Intl.NumberFormat
const formatted = new Intl.NumberFormat('en-US', {
  style: 'currency',
  currency: 'USD'
}).format(1234.56);

// ❌ uno-js percentage
import { toPercentage } from 'uno-js';

// ✅ Native API
const percentage = new Intl.NumberFormat('en-US', {
  style: 'percent',
  minimumFractionDigits: 2
}).format(0.1234);

// ❌ uno-js date formatting
// ✅ Native API - Intl.DateTimeFormat
const dateFormatted = new Intl.DateTimeFormat('en-US').format(new Date());

dateUtils.ts (Date manipulation)

Status: ⚠️ PARTIALLY DEPRECATED

// ❌ uno-js
import { compareDates } from 'uno-js';

// ✅ Native API - Date comparison
const compareResult = new Date(a) - new Date(b); // Returns difference in ms
const isAfter = new Date(a) > new Date(b);

// ❌ uno-js toLocalTime
// ✅ Native API - Temporal API (upcoming) or Date methods
const localDate = new Date().toLocaleString();

groupBy.ts

Status: ⚠️ PARTIALLY DEPRECATED

// ❌ uno-js
import { groupBy } from 'uno-js';
const grouped = groupBy(data, 'category');

// ✅ Native API - Object.groupBy (Stage 3, Chrome 117+)
const grouped = Object.groupBy(data, item => item.category);

// ✅ Alternative with Map.groupBy
const grouped = Map.groupBy(data, item => item.category);

// ✅ Fallback with reduce
const grouped = data.reduce((acc, item) => {
  (acc[item.category] ??= []).push(item);
  return acc;
}, {});

🔧 Functions That Retain Value

debounce.ts

Status: ✅ KEEP - No native API equivalent, but it's a standard implementation.

accurateSum.ts

Status: ✅ KEEP - Solves JavaScript-specific floating-point precision issues.

createCsv.ts

Status: ✅ KEEP - Business-specific functionality with no native equivalent.

dateRange.ts, weekUtils.ts

Status: ✅ KEEP - Complex business logic. Temporal API (future) might partially replace.

money.ts

Status: ✅ KEEP - Business-specific type, though formatting can use Intl.NumberFormat.

stringTemplate.ts

Status: ⚠️ EVALUATE - Native template literals (${variable}) cover most cases.

truncate.ts, delta.ts

Status: ✅ KEEP - Specific mathematical logic with no direct equivalent.

validateObject.ts, validateNotNull.ts

Status: ✅ KEEP - Specific validation utilities.

📋 Recommended Migration Plan

  1. Immediate: Replace abortController, removeDuplicated, toTitleCase, withEnter, SimpleObservable
  2. Short term: Migrate formatting to Intl APIs where possible
  3. Medium term: Evaluate groupBy when Object.groupBy has better support
  4. Long term: Monitor Temporal API to replace date utilities

🌐 Native API Browser Compatibility

  • AbortController: Chrome 66+, Firefox 57+, Safari 11.1+
  • Intl.NumberFormat: Chrome 24+, Firefox 29+, Safari 10+
  • Object.groupBy: Chrome 117+, Firefox 119+ (Stage 3)
  • EventTarget constructor: Chrome 64+, Firefox 59+, Safari 14+