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

@underlying/utils

v1.2.1

Published

Named eases (power, sine, expo, back, elastic, bounce, steps), cubicBezier, and animation helpers (clamp, mapRange, interpolate, snap, wrap, random) for @underlying/core. Tree-shakeable.

Readme

The named-ease and helpers layer for @underlying/core: the full named-ease library, cubicBezier, and the small helpers you reach for (clamp, mapRange, interpolate, snap, wrap, random). Tree-shakeable - you pay for what you import.

Note: for live motion a spring already gives you overshoot and settle, physically. Named eases are for baked motion - a timed tween, a scrubbable timeline - and for porting existing named-ease code.

npm install @underlying/utils @underlying/core

Eases

Every family - power1-power4, sine, expo, circ, back, elastic, bounce, steps, plus cubicBezier - is a plain function, so you can pass it straight in:

import { power2, back, elastic } from '@underlying/utils'

animate(card, { y: 0 }, { duration: 600, easing: power2.out })
animate(card, { y: 0 }, { duration: 600, easing: back.out })       // overshoot
animate(card, { y: 0 }, { duration: 900, easing: elastic.out })    // wobble

back, elastic and steps are configurable:

back(2).out            // stronger overshoot
elastic(1, 0.3).out    // amplitude, period
steps(5)               // a 5-step staircase
cubicBezier(0.25, 0.1, 0.25, 1)   // paste from any easing visualiser

power1-power4 also carry their conventional names - quad, cubic, quart, quint are the same families (quad === power1, cubic === power2, quart === power3, quint === power4), so you can import whichever name reads better. none is the linear identity (t => t):

import { cubic, quint, none } from '@underlying/utils'

animate(card, { y: 0 }, { duration: 600, easing: cubic.inOut })   // same as power2.inOut
animate(card, { x: 0 }, { duration: 400, easing: none })          // constant rate, no curve

Writing your own

A family is the three variants of one curve - the EaseFamily shape, where each Easing is (t: number) => number:

import type { EaseFamily } from '@underlying/utils'

const myEase: EaseFamily = {
  in: (t) => t * t,
  out: (t) => 1 - (1 - t) * (1 - t),
  inOut: (t) => (t < 0.5 ? 2 * t * t : 1 - (-2 * t + 2) ** 2 / 2),
}

animate(card, { y: 0 }, { duration: 600, easing: myEase.out })

Named eases by string

Import the side-effect entry once and @underlying/core resolves ease names - so existing ease-name code ports across unchanged:

import '@underlying/utils/register'

animate(card, { y: 0 }, { duration: 600, easing: 'power2.out' })
animate(card, { y: 0 }, { duration: 900, easing: 'elastic.out(1, 0.3)' })
animate(card, { y: 0 }, { duration: 600, easing: 'cubicBezier(0.25, 0.1, 0.25, 1)' })

A name with no variant defaults to .out (by convention). An unknown name warns once and falls back, never throws.

The /register entry calls registerEases() for you (and also wires up cubicBezier). If you would rather register the named families explicitly - in app code, or without importing the side-effect entry - call it yourself:

import { registerEases } from '@underlying/utils'

registerEases()   // registers power1-4, quad/cubic/quart/quint, sine, expo, circ, back, elastic, bounce, steps, none/linear

Helpers

import { clamp, mapRange, interpolate, snap, wrap, random, toArray, pipe } from '@underlying/utils'

clamp(value, 0, 1)
mapRange(scrollY, 0, 800, 0, 1)        // remap a range
interpolate(a, b, t)                    // lerp
snap(45, angle)                         // nearest multiple of 45
snap([0, 90, 180, 270], angle)          // nearest of a set
wrap(0, 360, angle + delta)             // carousels, angles
random(10, 20)                          // a number in [10, 20)
random(['a', 'b', 'c'])                 // a random element
toArray('.card')                        // selector / element / NodeList -> Element[]
pipe(addOne, double)                    // compose left to right

License

MIT (c) underlyi.ng