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

@untemps/utils

v4.0.0

Published

Utils for @untemps packages

Readme

@untemps/utils

Utils for @untemps packages.


npm


Documentation

A complete documentation of utils is available here: Docs

Installation

yarn add @untemps/utils

This package ships with full TypeScript declarations. No additional @types/* package needed.

Requirements: Node.js >= 20.

Usage

ESM / TypeScript

import { isNil, interpolate, createElement } from '@untemps/utils'

Per-module (tree-shakeable)

import { isNil } from '@untemps/utils/lang/isNil'
import { interpolate } from '@untemps/utils/string/interpolate'

CommonJS

const { isNil } = require('@untemps/utils')

Available utilities

Every utility is exported both from the package root and per-module at @untemps/utils/<category>/<name>. See the Docs for full signatures, parameters, and examples.

array

  • extractByIndices — extract values from an array at the given indices

async

  • debounce — delay invocation until after a quiet period; returns a function with .cancel()
  • standby — return a promise that resolves after the given delay
  • throttle — invoke at most once per interval (leading + trailing); returns a function with .cancel()

dom

  • createElement — create a DOM element from a configuration object. Attributes whose value is null or undefined are ignored (no-op for those keys), mirroring modifyElement
  • doElementsOverlap — check whether two DOM elements overlap on screen
  • getCSSDeclaration — find a CSS rule by class name across document.styleSheets. Returns a snapshot Record<string, string> of the declared properties (kebab-case keys, mirroring the CSS Object Model); mutating it has no effect on the live stylesheet. Pass returnText = true to get the raw cssText string instead.
  • getElement — query a DOM element by selector
  • isElement — check whether a value is a DOM element
  • modifyElement — set attributes on a DOM element (by reference or selector). An attribute whose value is null or undefined is removed instead of being set, allowing the same call to add and remove attributes in one pass. Throws ReferenceError when a selector matches nothing.
  • removeElement — remove a DOM element (by reference or selector)
  • resolveClassName — aggregate class names from strings or [condition, ifTrue, ifFalse] tuples

function

  • isFunction — check whether a value is a function

lang

  • isNil — check whether a value is null or undefined

number

  • clamp — clamp a number between two bounds
  • getRandomInteger — return a pseudo-random integer in [min, max]
  • normalizeMinMax — return { min, max } with min <= max, swapping the inputs if needed

object

  • deepClone — structured-clone deep copy. Throws DataCloneError on functions, DOM nodes, or other non-cloneable values. Use deepMerge if you need a lenient clone that keeps such values by reference.
  • deepMerge — recursively merge source into target with circular-reference support. Pass true as the third argument to merge into target in place instead of producing a new object.
  • isObject — check whether a value is a plain object

string

  • generateText — generate a string from a dictionary using configurable rules
  • generateTokenizedText — like generateText but also returns token indices
  • interpolate — replace %key%-style tokens in a string
  • interpolateLiteral — replace ${key}-style tokens in a literal-like string
  • isString — check whether a value is a string

Development

The development toolchain targets Node 24, pinned via .nvmrc:

nvm use

Consumers only need Node >= 20 (see Installation); the higher floor is for working on the project itself.