webgif

1.1.0 • Public • Published

logo

Easily generate animated GIFs from websites

Build Status Build status Greenkeeper badge node NPM Version

  • Easy 👉 Just point it to a URL and get an animated GIF!
  • Cross-platform 👉 Works on Windows, Mac, Linux, without Docker!
  • Headless 👉 Uses GoogleChrome/puppeteer
  • Inspired 👉 By asciicast2gif and wanting to make it easier to use

Installation

yarn global add webgif || npm i -g webgif

Usage

To navigate to https://giphy.com/search/lol and make an animated GIF of duration 10 seconds, execute:

webgif -u https://giphy.com/search/lol -d 10
 
Navigating to URL: https://giphy.com/search/lol
Taking screenshots: .............
Encoding GIF: /home/user/web.gif

Options

webgif -u URL -d DURATION [-o OUTFILE]
 
Options:
  --url, -u       URL to generate GIF from
                                       [default: "https://giphy.com/search/lol"]
  --duration, -d  GIF duration in seconds                          [default: 10]
  --output, -o    Output file name
                             [default: "web.gif"]
  -h, --help      Show help                                            [boolean]
  -V, --version   Show version number                                  [boolean]

Sample GIF

Sample GIF

How it works

  1. Use Puppeteer to launch a headless Chrome window
  2. Use setInterval to take screenshots and save them to disk
  3. Navigate to target URL and wait for specified duration
  4. Use gifencoder and png-file-stream to create animated GIF out of saved screenshots

See code: index.js

Readme

Keywords

Package Sidebar

Install

npm i webgif

Weekly Downloads

2

Version

1.1.0

License

MIT

Unpacked Size

11.5 kB

Total Files

10

Last publish

Collaborators

  • anishkny