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

@penner/classic-easing

v0.0.2

Published

Classic Penner easing equations with normalized (0-1) signatures

Downloads

193

Readme

@penner/classic-easing

The classic Penner easing equations, ported to TypeScript with normalized (t: number) => number signatures.

This is a faithful port of the original ActionScript functions from 2001: the same math and the same names, with a modern API.

Installation

npm install @penner/classic-easing

Usage

Every easing function takes a normalized time t in [0, 1] and returns a value typically in [0, 1]:

import {
  easeOutQuad,
  easeInOutCubic,
  easeOutBounce,
} from '@penner/classic-easing';

const progress = easeOutQuad(0.5); // 0.75
const smooth = easeInOutCubic(0.5); // 0.5
const bounced = easeOutBounce(0.8); // ~0.95

Use with any animation system that accepts (t: number) => number:

import { easeOutElastic } from '@penner/classic-easing';

element.animate(keyframes, {
  duration: 1000,
  easing: `linear`, // use Web Animations API timing
});

// Or apply the easing manually to a 0-1 progress value
const easedProgress = easeOutElastic(t);

Easing Functions

Simple Eases

All simple easing functions are exported as ready-to-use (t: number) => number:

| Family | In | Out | InOut | | ------ | -------------- | --------------- | ----------------- | | Quad | easeInQuad | easeOutQuad | easeInOutQuad | | Cubic | easeInCubic | easeOutCubic | easeInOutCubic | | Quart | easeInQuart | easeOutQuart | easeInOutQuart | | Quint | easeInQuint | easeOutQuint | easeInOutQuint | | Sine | easeInSine | easeOutSine | easeInOutSine | | Expo | easeInExpo | easeOutExpo | easeInOutExpo | | Circ | easeInCirc | easeOutCirc | easeInOutCirc | | Bounce | easeInBounce | easeOutBounce | easeInOutBounce |

Plus linear — the identity function.

Back Easing (with overshoot)

Default exports use the classic overshoot strength of 1.70158 (~10% overshoot):

import { easeInBack, easeOutBack, easeInOutBack } from '@penner/classic-easing';

Use factory functions to customize the overshoot strength:

import {
  createEaseInBack,
  createEaseOutBack,
  createEaseInOutBack,
} from '@penner/classic-easing';

const gentleBack = createEaseOutBack({ strength: 1 });
const aggressiveBack = createEaseOutBack({ strength: 3 });
const cubicNoOvershoot = createEaseInBack({ strength: 0 }); // equivalent to cubic

Elastic Easing (with oscillation)

Default exports use amplitude 1 and period 0.3 (0.45 for InOut):

import {
  easeInElastic,
  easeOutElastic,
  easeInOutElastic,
} from '@penner/classic-easing';

Use factory functions to customize amplitude and period:

import {
  createEaseOutElastic,
  createEaseInOutElastic,
} from '@penner/classic-easing';

const bouncy = createEaseOutElastic({ amplitude: 1.5, period: 0.2 });
const gentle = createEaseOutElastic({ period: 0.5 });
const inOut = createEaseInOutElastic({ amplitude: 1.2, period: 0.6 });

Types

import type {
  EasingFn,
  BackConfig,
  ElasticConfig,
} from '@penner/classic-easing';
  • EasingFn(t: number) => number
  • BackConfig{ strength?: number }
  • ElasticConfig{ amplitude?: number; period?: number }

Comparison with @penner/easing

  • This package preserves the original 2001 equations and classic naming conventions (easeInQuad, easeOutBounce).
  • The sibling @penner/easing package reimagines the same easing families with physics-based parameters — configuring bounce by number of bounces and restitution, elastic by cycles and decay, and so on.
  • Use classic-easing when you want the exact original formulas with a modern signature
  • Use @penner/easing when you want more intuitive, physically meaningful configuration.

License

MIT