Neutral Point Measurement
Have opinions about JavaScript? We want to hear them. Take the 2018 JavaScript Ecosystem Survey »

gif-me-duration

1.0.7 • 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.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 ^7.6

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

34

version

1.0.7

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability