# tween-functions

> Robert Penner's easing functions, slightly modified

Latest version **1.2.0** (published 2015-11-21) · BSD license · 0 weekly downloads

## Install

```sh
npm install tween-functions
pnpm add tween-functions
yarn add tween-functions
bun add tween-functions
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2015-11-21 |
| First published | 2015-03-17 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | separate (@types/tween-functions) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 195 |
| Author | chenglou |
| Maintainers | chenglou |
| Keywords | tween, ease, react, animation, easing, penner, bezier, interpolation |

## Links

- npm: https://www.npmjs.com/package/tween-functions
- Repository: https://github.com/chenglou/tween-functions
- Issues: https://github.com/chenglou/tween-functions/issues
- npm.io page: https://npm.io/package/tween-functions

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2015-11-21
- 1.1.0 — 2015-10-16
- 1.0.2 — 2015-05-26
- 1.0.1 — 2015-03-17
- 1.0.0 — 2015-03-17

## README

# Tween-functions

Robert Penner's tweening functions as used in [React-tween-state](https://github.com/chenglou/react-tween-state) and [React-state-stream](https://github.com/chenglou/react-state-stream).

Penner's original functions uses the change in value rather than final value as parameter. I much prefer the latter, so this is what this library will use.

## API

`tweenFunction.tweenName(currentTime, beginValue, endValue, totalDuration)`

## Example

```js
var tweenFunctions = require('tween-functions');
tweenFunctions.easeInQuad(1, 0, 50, 5); // => 4
```

List of available functions:

- linear
- easeInQuad
- easeOutQuad
- easeInOutQuad
- easeInCubic
- easeOutCubic
- easeInOutCubic
- easeInQuart
- easeOutQuart
- easeInOutQuart
- easeInQuint
- easeOutQuint
- easeInOutQuint
- easeInSine
- easeOutSine
- easeInOutSine
- easeInExpo
- easeOutExpo
- easeInOutExpo
- easeInCirc
- easeOutCirc
- easeInOutCirc
- easeInElastic
- easeOutElastic
- easeInOutElastic
- easeInBack
- easeOutBack
- easeInOutBack
- easeInBounce
- easeOutBounce
- easeInOutBounce

---
_Source: https://npm.io/package/tween-functions · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
