# tweeen

> Allows to «animate» number values with given duration

Latest version **1.0.5** (published 2019-01-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install tweeen
pnpm add tweeen
yarn add tweeen
bun add tweeen
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2019-01-25 |
| First published | 2019-01-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | sunify |

## Links

- npm: https://www.npmjs.com/package/tweeen
- npm.io page: https://npm.io/package/tweeen

## Dependencies (1)

- [run-with-fps](https://npm.io/package/run-with-fps.md) ^1.0.4

## Recent versions

- 1.0.5 (latest) — 2019-01-25
- 1.0.4 — 2019-01-25
- 1.0.3 — 2019-01-23
- 1.0.2 — 2019-01-22
- 1.0.1 — 2019-01-22
- 1.0.0 — 2019-01-22

## README

# Primitive tween function

Allows to «animate» number values with given duration

## Usage

```es6
import tween from 'nano-tween';

const stop = tween(1, 100, (value) => {
  console.log(value);
}, {
  duration: 1000,
});
```

## Params

Signature of tween function

```ts
function tween(
  from: number,
  to: number,
  cb: (value: number) => void,
  params?: TweenParams,
);
```

### List of params

- `duration` — duration in ms, defaults to `300`
- `easing` — simple easing function that takes one argument — time (from 0 to 1). Defaults to `linear`. You can use functions from [eases](https://www.npmjs.com/package/eases) or similar package
- `fps` — defaults to `60`
- `end` — animation end callback

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