1.0.8 • Published 4 years ago

gif-me-duration v1.0.8

Weekly downloads
81
License
ISC
Repository
github
Last release
4 years ago

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

1.0.8

4 years ago

1.0.7

6 years ago

1.0.6

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago