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

@fastkit/helpers

v0.15.0

Published

A small collection of helper implementations for processing primitive values and objects.

Downloads

774

Readme

@fastkit/helpers

🌐 English | 日本語

A collection of small helper implementations for processing primitive values and objects.

Features

  • Full TypeScript Support: Provides type-safe operations with strict type definitions
  • Lightweight: Minimized size with minimal necessary dependencies
  • Multi-functional: Supports a wide range of data types including strings, arrays, objects, and numbers
  • Practical: Functions commonly used operations in actual development
  • Zero Dependencies: Can be used standalone without depending on external libraries

Installation

npm install @fastkit/helpers
# or
pnpm add @fastkit/helpers

Basic Usage

String Processing

import {
  capitalize,
  toHalfWidth,
  stripIndent,
  removeSpace
} from '@fastkit/helpers';

// Capitalize the first character
capitalize('helloWorld'); // → 'HelloWorld'

// Convert full-width characters to half-width
toHalfWidth('HELLO WORLD'); // → 'HELLO WORLD'

// Normalize indentation
const code = stripIndent(`
  const message = 'Hello';
  console.log(message);
`);

// Remove spaces
removeSpace('Hello World'); // → 'HelloWorld'

Array Operations

import {
  arrayUnique,
  arrayRemove,
  range,
  flattenRecursiveArray
} from '@fastkit/helpers';

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

// Remove element (modifies original array)
const arr = [1, 2, 3];
arrayRemove(arr, 2); // arr becomes [1, 3]

// Generate range array
range(3); // → [0, 1, 2]
range(3, 5); // → [5, 6, 7]

// Flatten recursive array
flattenRecursiveArray([1, [2, [3, 4]]]); // → [1, 2, 3, 4]

Object Operations

import {
  isPlainObject,
  pickProperties,
  omitProperties,
  removeUndef,
  mixin
} from '@fastkit/helpers';

// Check if plain object
isPlainObject({}); // → true
isPlainObject(new Date()); // → false

// Select properties
const obj = { a: 1, b: 2, c: 3 };
pickProperties(obj, ['a', 'c']); // → { a: 1, c: 3 }

// Exclude properties
omitProperties(obj, ['b']); // → { a: 1, c: 3 }

// Remove undefined properties
removeUndef({ a: 1, b: undefined, c: 3 }); // → { a: 1, c: 3 }

// Mixin objects
const base = { a: 1 };
const trait = { b: 2 };
const mixed = mixin(base, trait); // { a: 1, b: 2 }

Type Checking & Utilities

import {
  isEmpty,
  notEmptyValue,
  inNonNullable,
  toNumber
} from '@fastkit/helpers';

// Empty value check
isEmpty(''); // → true
isEmpty([]); // → true
isEmpty(null); // → true
isEmpty('hello'); // → false

// Get first non-empty value
notEmptyValue(['', null, 'hello']); // → 'hello'

// null/undefined check
inNonNullable(value); // value is not null | undefined

// Number conversion
toNumber('123'); // → 123
toNumber('123.45'); // → 123.45

API

String Processing

capitalize<T extends string>(str: T): Capitalize<T>

Capitalizes the first character of a string

uncapitalize<T extends string>(str: T): Uncapitalize<T>

Uncapitalizes the first character of a string

toHalfWidth(source: string | null | undefined): string

Converts full-width characters to half-width

removeSpace(source: string | null | undefined): string

Removes all spaces and tab characters

stripIndent(str: string, retainUnnecessaryLines?: boolean): string

Normalizes indentation by removing the minimum indent count

Array Operations

arrayUnique<T>(array: T[]): T[]

Returns array with duplicates removed

arrayRemove<T>(array: T[], entry: T): void

Removes specified element from array (destructive operation)

range(length: number, offset?: number): number[]

Generates numeric array of specified range

flattenRecursiveArray<T>(source: RecursiveArray<T>): T[]

Flattens recursive array

Object Operations

isPlainObject<T>(value: unknown): value is T

Determines whether value is a plain object

isObject<T>(value: unknown): value is T

Determines whether value is an instance derived from Object class

pickProperties<T, K>(obj: T, props: K[]): Pick<T, K>

Extracts only specified properties

omitProperties<T, K>(obj: T, props: K[]): Omit<T, K>

Excludes specified properties

mixin<T, U>(base: T, trait: U): Mixin<T, U>

Generates a Proxy that mixes objects

Number Operations

toInt(value: string | number): number

Converts to integer value

toFloat(value: string | number): number

Converts to floating-point number

toNumber(source: any): number

Normalizes to number

Utilities

isEmpty(value: any): boolean

Determines whether value is empty

notEmptyValue<T>(args: T[], defaultValue?: T): T

Returns first non-empty value from array

inNonNullable<T>(value: T): value is Exclude<T, null | undefined>

Determines whether value is not null or undefined

Dependencies

  • @fastkit/ts-type-utils: TypeScript type utilities (within same repository)

Documentation

For detailed documentation, please visit here.

License

MIT