How to Automatically Take Screenshots Of Your Site With TLapse


When you’re building a front end project, unless you’re committing very often, you probably want to see your progress for historical reasons.  Like the famous saying, there’s a tool for that.  TLapse is a NPM module that allows you to start a server in the background and periodically take screenshots of your website with your desired dimensions.

To install the tool, run

npm install -g tlapse

start your web server for your project, let say it runs on localhost:3000, you would run the following to allow tlapse to listen to it:

tlapse --every 1m --directory ./screens -- localhost:3000 1366x768

the command above will take screenshots sized at 1366×768 pixels and place them in screens folder every minute.  The command is smart enough to NOT take screenshots if it detects no difference within the last time interval.

If you want tlapse to take screenshot of a specific selector, you can do so like this:

tlapse --every 1m --directory ./screens -- localhost:3000 1366x768 --selector='.my-container'

from my experience, the selector feature isn’t very robust, I would often get cropped images and sometimes it simply doesn’t render anything from the selector.  Since the project is open source, I encourage you all to contribute to it.


Since TLapse is built on top of pageres-cli, you can pass any parameter from pageres into the command line.

-v, --verbose

Verbose output to see errors if you need to troubleshoot.

-c, --crop

Crop to the set height.

$ pageres 1024x768 --crop
-d, --delay=<number>

Delay screenshot capture.

$ pageres 1024x768 --delay=3

Custom filename.

$ pageres 1024x768 --filename='<%= date %> - <%= url %>'

Capture DOM element.

$ pageres 1366x768 --selector='.page-header'

Hide DOM element. Can be set multiple times.

$ pageres 1366x768 --hide='.page-header'

Override a global crop option within a group.

$ pageres [ 1366x768 --no-crop ] 1024x768 --crop

Apply custom CSS to the webpage. Specify some CSS or the path to a CSS file.

$ pageres --css='body { background: red; }'
$ pageres --css='style.css'

Browser cookie. Can be set multiple times.

$ pageres --cookie='foo=bar'

Custom HTTP request header. Can be set multiple times.

$ pageres --header='Cache-Control: no-cache'

Username for HTTP auth.


Password for HTTP auth.


Scale webpage n of times.


Image format. Either png (default) or jpg.


Custom user agent.

For more info about pageres-cli, check it out at:

I find TLapse useful to reference changes you made to the front end of your project, and it’s especially useful if you want to string all the images together to create a time lapse website GIF for your client or your team!

Comments Or Questions? Discuss In Our Discord

If you enjoyed this tutorial, make sure to subscribe to our Youtube Channel and follow us on Twitter @pentacodevids for latest updates!

More from PentaCode