timeline-gif

0.0.2 • Public • Published

timeline-gif

Extract the screenshots stored in Chrome Devtool timeline files into gifs

This code is based on code from @pmdartus see also his repository

Features

  • Convert timeline to gif
  • Extract screenshots save in a timeline into a folder

Install

ensure that your version of node is greater than 4.0.

npm install -g timeline-gif

CLI usage

> timeline-gif -h
 
Usage: timeline-gif <timeline> [options]
 
Options:
--help        Show help                                              [boolean]
-o, --output  Output file name              [string] [default: "timeline.gif"]
-f, --fps     Number of frames per seconds            [number] [default: "10"]
-q, --quality Set the quality                         [number] [default: "20"]

Node usage

const timelinegif = require('timeline-gif')
const timeline = require('./my-awesome-timeline.json')
 
const options = {
  fps: 10,
  quality, 20
}
 
timelinegif.toGif(timeline, options)
  .then(gifPath => console.log(`The gif(t) is ready: ${gifPath}!`))

API

timelinegif.toGif(timeline[, options])

  • file - The timeline file
  • options.output - path of the gif. default: ./timeline.gif
  • options.fps - Number of frames per seconds. default: 10
  • options.quality - Number of frames per seconds. default: 20
  • options.tmp - path of the temporary folder for the screenshots. default: ./tmp-screenshots

Returns a Promise that resolves with the path of the created gif

timelinegif.getTimelineEntries(file[, fps])

  • file - The timeline file to convert
  • fps - Number of frames per seconds. default: 10

Returns a Promise that resolves with the screenshot entries read from the file

timelinegif.timelineEntriesToGif(entries[, options])

  • entries <timelineEntry[]> - The parsed JSON content of the timeline file
  • options.output - path of the gif. default: ./timeline.gif
  • options.fps - Number of frames per seconds. default: 10
  • options.quality - Number of frames per seconds. default: 20
  • options.tmp - path of the temporary folder for the screenshots. default: ./tmp-screenshots

Returns a Promise that resolves with the path of the path of the created directory

License

MIT. See /LICENSE

Owner

Justin Verkuijl - @djusv

Package Sidebar

Install

npm i timeline-gif

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

11.5 kB

Total Files

8

Last publish

Collaborators

  • djusv