gif-me-duration

    1.0.8 • Public • Published

    gif-me-duration

    Promise-based gif duration module.

    Install

    npm i gif-me-duration

    Notes

    Essentially, this module just uses a very small part of gify-parse allowing users to get the duration for a single gif url or an array of gif urls.

    Updates:

    • 1.0.8: removed axios dependency in favor of smaller node-fetch
    • 1.0.6: simplified img to binary process
    • 1.0.4: allows single or array of gif urls.

    Authors

    Table of Contents

    1. How to Use
    2. Usage
    3. Requirements
    4. Contributing
    5. Acknowledgments

    Usage

    npm i gif-me-duration

    How to Use

    // Require or import the package (name it anything you'd like) wherever you'd like to use it:
    const gifDurations = require('gif-me-duration');
     
    // Function takes in a single url or array of gif urls
    let gifUrls = [
      'http://media2.giphy.com/media/FiGiRei2ICzzG/200.gif',
      'http://media0.giphy.com/media/feqkVgjJpYtjy/200.gif'
    ];
     
    // Use an async function to await the results
    const asyncExample = async () => {
      let result = await gifDurations(gifUrls);
      console.log(result);
    }
     
    // Or use .then promise chain to access results 
    const promiseExample = () => {
      gifDurations(gifUrls)
      .then(results => console.log(results))
    };

    Requirements

    • Node ^8

    Contributing

    This was intentionally made to be a very limited use, but if you would like to contribute please make a pull request with your work. Feel free to contact me and introduce yourself as well.

    Acknowledgments

    Install

    npm i gif-me-duration

    DownloadsWeekly Downloads

    128

    Version

    1.0.8

    License

    ISC

    Unpacked Size

    7.04 kB

    Total Files

    5

    Last publish

    Collaborators

    • streed12