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

@lutlelk-tools/core

v1.0.0

Published

Core utility functions and types used across all lutlelk-tools packages

Readme

@lutlelk-tools/core

Core utility library providing type guards and common helper functions for JavaScript/TypeScript.

Installation

npm install @lutlelk-tools/core
# or
pnpm add @lutlelk-tools/core
# or
yarn add @lutlelk-tools/core

Usage

import { isString, isNumber, isEmpty, noop, times } from '@lutlelk-tools/core'

API

Type Guards

isString(value: unknown): value is string

Check if value is a string.

isString('hello') // => true
isString(123) // => false

isNumber(value: unknown): value is number

Check if value is a number (not NaN).

isNumber(123) // => true
isNumber(NaN) // => false
isNumber('123') // => false

isBoolean(value: unknown): value is boolean

Check if value is a boolean.

isBoolean(true) // => true
isBoolean(1) // => false

isNull(value: unknown): value is null

Check if value is null.

isNull(null) // => true
isNull(undefined) // => false

isUndefined(value: unknown): value is undefined

Check if value is undefined.

isUndefined(undefined) // => true
isUndefined(null) // => false

isNil(value: unknown): value is null | undefined

Check if value is null or undefined.

isNil(null) // => true
isNil(undefined) // => true
isNil(0) // => false

isFunction(value: unknown): value is (...args: any[]) => any

Check if value is a function.

isFunction(() => {}) // => true
isFunction('function') // => false

isArray(value: unknown): value is any[]

Check if value is an array.

isArray([1, 2, 3]) // => true
isArray({}) // => false

isObject(value: unknown): value is Record<string, any>

Check if value is an object (not null, not array).

isObject({}) // => true
isObject([]) // => false
isObject(null) // => false

isPlainObject(value: unknown): value is Record<string, any>

Check if value is a plain object (created by Object or null prototype).

isPlainObject({}) // => true
isPlainObject(new Date()) // => false
isPlainObject([]) // => false

isEmpty(value: unknown): boolean

Check if value is empty.

isEmpty('') // => true
isEmpty([]) // => true
isEmpty({}) // => true
isEmpty(null) // => true
isEmpty([1]) // => false

Utility Functions

noop(): void

A no-operation function.

noop() // Does nothing

identity<T>(value: T): T

Returns the first argument.

identity(42) // => 42
identity('hello') // => 'hello'

times<T>(n: number, iteratee: (index: number) => T): T[]

Call iteratee n times and return results.

times(3, i => i * 2)
// => [0, 2, 4]

toString(value: unknown): string

Convert value to string.

toString(123) // => '123'
toString({ a: 1 }) // => '{"a":1}'
toString(null) // => ''

toNumber(value: unknown): number

Convert value to number.

toNumber('123') // => 123
toNumber('abc') // => 0
toNumber(true) // => 1

toBoolean(value: unknown): boolean

Convert value to boolean.

toBoolean('true') // => true
toBoolean('false') // => false
toBoolean(1) // => true
toBoolean(0) // => false

isStrictEqual(a: unknown, b: unknown): boolean

Strict equality check.

isStrictEqual(1, 1) // => true
isStrictEqual(1, '1') // => false

License

ISC