Nonconformist Propaganda Machine
    Wondering what’s next for npm?Check out our public roadmap! »

    fast-forward-numbers

    1.0.20 • Public • Published

    Fast Forward Numbers

    A library used to animate numbers, incrementing them until the final number is reached.

    How to use?

    Step 1: Install with NPM.

    npm install --save fast-forward-numbers
    

    Step 2: Using Webpack, load the required JS:

    import fastForward from 'fast-forward-numbers';
    

    Step 3: Call the function below inside your code:

    fastForward(element, startNumber, endNumber, time(optional), speed(optional));
    

    where...

    element - an element the function is called on.
    startNumber - animation will start with this number.
    endNumber - animation will end with this number.
    time (optional) - time it takes for numbers to be animated. Expressed in ms (default: 3000).
    speed (optional) - speed at which numbers are animated. Increase to increase increment count, decrease to decrease increment count (default: 1).
    

    Example:

    HTML

    <p class="ffn-class">0</p>
    

    JS

    import fastForward from 'fast-forward-numbers';
    
    const ffn = document.querySelector(".ffn-class");
    fastForward(ffn, 0, 50);
    

    Enjoy!

    Install

    npm i fast-forward-numbers

    DownloadsWeekly Downloads

    3

    Version

    1.0.20

    License

    ISC

    Unpacked Size

    1.82 kB

    Total Files

    3

    Last publish

    Collaborators

    • avatar