0.0.2 • Published 5 years ago

timeline-gif v0.0.2

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

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