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

@rabjs/kit

v0.0.3

Published

A comprehensive TypeScript utility library with 100+ helper functions for arrays, objects, strings, functions, numbers, dates, promises, and more. Similar to lodash but with full TypeScript support and tree-shaking friendly.

Readme

@rabjs/kit

Build Status npm version codecov

A comprehensive TypeScript utility library with 100+ helper functions for arrays, objects, strings, functions, numbers, dates, promises, and more. Similar to lodash but with full TypeScript support and tree-shaking friendly.

Features

  • TypeScript First: Complete type definitions with full TypeScript support
  • Tree-shaking Friendly: Only import what you need, reduce bundle size
  • High Test Coverage: 90%+ test coverage with 675+ test cases
  • Multiple Module Formats: CommonJS and ES Module support
  • Modern Tooling: Built with Rollup, tested with Jest
  • 100+ Functions: Comprehensive utility library across 10+ categories

Installation

npm install @rabjs/kit
# or
yarn add @rabjs/kit
# or
pnpm add @rabjs/kit

Quick Start

Import Everything

import * as kit from '@rabjs/kit';

kit.chunk([1, 2, 3, 4, 5], 2); // [[1, 2], [3, 4], [5]]
kit.debounce(() => console.log('hello'), 300);

Import Specific Functions

import { chunk, debounce } from '@rabjs/kit';

chunk([1, 2, 3, 4, 5], 2); // [[1, 2], [3, 4], [5]]
debounce(() => console.log('hello'), 300);

Import from Submodules

import { chunk } from '@rabjs/kit/array';
import { debounce } from '@rabjs/kit/function';

chunk([1, 2, 3, 4, 5], 2);
debounce(() => console.log('hello'), 300);

API Documentation

Array Functions

  • chunk(array, size) - Split array into chunks
  • compact(array) - Remove falsy values
  • flatten(array, depth) - Flatten array
  • flattenDeep(array) - Deep flatten
  • uniq(array) - Remove duplicates
  • uniqBy(array, iteratee) - Remove duplicates by condition
  • difference(...arrays) - Get difference
  • intersection(...arrays) - Get intersection
  • union(...arrays) - Get union
  • And more...

Object Functions

  • clone(obj) - Shallow clone
  • cloneDeep(obj) - Deep clone
  • merge(target, ...sources) - Merge objects
  • mergeDeep(target, ...sources) - Deep merge
  • pick(obj, keys) - Pick properties
  • omit(obj, keys) - Omit properties
  • get(obj, path, defaultValue) - Safe get
  • set(obj, path, value) - Safe set
  • And more...

String Functions

  • camelCase(str) - Convert to camelCase
  • kebabCase(str) - Convert to kebab-case
  • snakeCase(str) - Convert to snake_case
  • pascalCase(str) - Convert to PascalCase
  • capitalize(str) - Capitalize string
  • trim(str, chars) - Trim characters
  • truncate(str, options) - Truncate string
  • And more...

Function Utilities

  • debounce(func, wait, options) - Debounce function
  • throttle(func, wait, options) - Throttle function
  • once(func) - Execute once
  • memoize(func, resolver) - Cache results
  • curry(func, arity) - Curry function
  • compose(...funcs) - Compose functions
  • pipe(...funcs) - Pipe functions
  • And more...

Number Functions

  • clamp(number, lower, upper) - Clamp number
  • random(lower, upper, floating) - Generate random number
  • round(number, precision) - Round number
  • sum(numbers) - Sum array
  • mean(numbers) - Average
  • median(numbers) - Median
  • range(start, end, step) - Generate range
  • And more...

Type Checking

  • isArray(value) - Check if array
  • isObject(value) - Check if object
  • isString(value) - Check if string
  • isNumber(value) - Check if number
  • isFunction(value) - Check if function
  • isPromise(value) - Check if promise
  • And more (20+ type checkers)...

Date Functions

  • format(date, formatStr) - Format date
  • parse(dateStr, formatStr) - Parse date
  • addDays(date, amount) - Add days
  • diffDays(date1, date2) - Difference in days
  • And more...

Promise Utilities

  • delay(ms, value) - Delay execution
  • retry(fn, options) - Retry function
  • timeout(promise, ms, message) - Promise timeout
  • parallel(tasks, concurrency) - Run in parallel
  • series(tasks) - Run in series
  • And more...

Collection Operations

  • groupBy(collection, iteratee) - Group by property
  • keyBy(collection, iteratee) - Create key-value map
  • sortBy(collection, iteratees) - Sort collection
  • partition(collection, predicate) - Partition collection
  • countBy(collection, iteratee) - Count by property
  • And more...

Math Functions

  • max(numbers) - Get maximum
  • min(numbers) - Get minimum
  • maxBy(array, iteratee) - Get max by condition
  • minBy(array, iteratee) - Get min by condition
  • And more...

Usage Examples

Array Operations

import { chunk, compact, flatten, uniq } from '@rabjs/kit';

// Chunk array
chunk([1, 2, 3, 4, 5], 2); // [[1, 2], [3, 4], [5]]

// Remove falsy values
compact([0, 1, false, 2, '', 3]); // [1, 2, 3]

// Flatten array
flatten(
  [
    [1, 2],
    [3, [4, 5]],
  ],
  1,
); // [1, 2, 3, [4, 5]]

// Remove duplicates
uniq([1, 2, 2, 3, 3, 3]); // [1, 2, 3]

Object Operations

import { get, set, pick, omit, merge } from '@rabjs/kit';

const obj = { a: { b: { c: 1 } } };

// Safe get
get(obj, 'a.b.c'); // 1
get(obj, 'a.x.y', 'default'); // 'default'

// Safe set
set(obj, 'a.b.d', 2); // { a: { b: { c: 1, d: 2 } } }

// Pick properties
pick(obj, ['a']); // { a: { b: { c: 1 } } }

// Omit properties
omit(obj, ['a']); // {}

// Merge objects
merge({ a: 1 }, { b: 2 }); // { a: 1, b: 2 }

Function Utilities

import { debounce, throttle, once } from '@rabjs/kit';

// Debounce
const handleSearch = debounce((query) => {
  console.log('Searching for:', query);
}, 300);

// Throttle
const handleScroll = throttle(() => {
  console.log('Scrolling...');
}, 1000);

// Execute once
const handleInit = once(() => {
  console.log('Initializing...');
});

String Operations

import { camelCase, kebabCase, capitalize } from '@rabjs/kit';

camelCase('hello-world'); // 'helloWorld'
kebabCase('helloWorld'); // 'hello-world'
capitalize('hello'); // 'Hello'

Browser Support

  • Chrome >= 70
  • Safari >= 12
  • Firefox >= 65
  • Edge >= 79

Node.js Support

  • Node.js >= 12

Contributing

We welcome contributions! Please read our contributing guidelines to get started.

License

MIT

Changelog

See CHANGELOG.md for detailed version history.