Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

drain-js

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drain-js

Makes smooth transitions between two numbers.

  • 0.2.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

drain-js

npm License

gif

A callback based utility for making fluent number changes.

Install

npm install drain-js
yarn add drain-js

Usage

import drain from 'drain-js';

drain({ start: 3000, end: 2750, onInterval: console.log });

// Output
2906
2812
2803
...
2752
2751
2750

Parameters

drain({
  start: Number,
  end: Number,
  speed?: Number,
  onInterval?: Function,
  onComplete?: Function,
});
NameDefaultDescription
speed100An animation can be completed in about 10 to 20 steps. The speed (ms) value is the time set for each step.
startundefinedThe value at which the animation will start
endundefinedThe value at which the animation will end.
onIntervalundefinedThe function that will run at each step until the animation is complete.
onCompleteundefinedThe function to run when the animation is complete.

Demo List

NameStatusURL
DemoWIP-
Demo with React✔️Link
Demo with VueWIP-
Demo with SvelteWIP-

Keywords

FAQs

Package last updated on 04 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc