0.1.29 • Published 4 years ago

site-recorder v0.1.29

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

site-recorder

Build Status

Why

site-recorder is a CLI tool for creating comparable image/video artefact. You can pass url and get GIF animation or video loading passed website from the first network request till time to interactive. It's not possible to write real video with for ex. WebRTC, because in that case we have to wait when our script will be loaded. Instead, we are using puppeteer and generated trace.json to get screenshots which demonstrate how site is loading.

Example: http://ronnyr34.wixsite.com/mysite-1

npm.io

Example

npx site-recorder -gif https://google.com https://wix.com

The result is recorded video and gif-animation of loading passed url.

Custom script example:

npx site-recorder -gif --custom-script ../src/examples/long-wait-task.js

Tech

site-recorder uses a number of open source projects to work properly:

  • puppeteer - Puppeteer is a Node library which provides a high-level API to control Chrome or Chromium over the DevTools Protocol.
  • Commander.js - The complete solution for node.js command-line interfaces.
  • ffmpeg - A complete, cross-platform solution to record, convert and stream audio and video.
  • fluent-ffmpeg - This library abstracts the complex command-line usage of ffmpeg into a fluent, easy to use node.js module.
  • gif-encoder - Streaming GIF encoder

And of course site-recorder itself is open source with a public repository on GitHub.

Prerequisites

site-recorder requires:

Usage

Usage: site-recorder [options] <url1 ...> <url2 ...>

Options:

OptionDescription
-v,--versionoutput the version number
-d,--debugsee full error messages, mostly for debugging
-gif,--generate-gifgenerate gif as additional output
-W, --resolution-width widthdefine the resolution width in the screen recording
-H, --resolution-height heightdefine the resolution height in the screen recording
-D, --device devicedefine the device that will run the screen recording (Override resolution param
-N, --network networkdefine the throttler that will emulate network slowdown
-t,--timeout navigation-timeoutnavigation timeout for loading event in puppeteer (default: 30000)
-cs, --custom-script path-to-fileadd path to custom script that will execute once page is loaded (receives page as argument)
-bw, --disable-colorsminimize color and styling usage in output
-h,--helpoutput usage information

Using of artifacts

Both output.mp4 and output.gif are extracted in the same folder as where command is executed.

Installation

Install the dependencies and devDependencies and start the server.

npm install site-recorder -g
npm run example:gif # generates both gif and video

Development

Want to contribute? Great! Please take a look at opened issues. Related TeamCity: http://tc.dev.wixpress.com/viewType.html?buildTypeId=SiteRecorder_SiteRecorder_O

Using site recorder as Library

Exposed several function to allow using site recorder as library for services.

  • execute Default module - execute the site recorder on two urls
  • devices - return array of devices
  • networks - return array of networks
API
exexute (urls, options)
devices ()
networks ()
NameDescription
urlsArray of two urls that will be recorder
optionsresolution-width: number
resolution-height: number
device: string - valid value from devices
network: string - valid value from networks
timeout: number in millisecond
disable-colors: boolean
Installation
npm install site-recorder

License

MIT

0.1.29

4 years ago

0.1.28

4 years ago

0.1.27

4 years ago

0.1.26

4 years ago

0.1.25

4 years ago

0.1.24

4 years ago

0.1.23

4 years ago

0.1.22

4 years ago

0.1.21

4 years ago

0.1.20

4 years ago

0.1.19

4 years ago

0.1.18

4 years ago

0.1.17

4 years ago

0.1.16

4 years ago

0.1.15

4 years ago

0.1.14

4 years ago

0.1.13

4 years ago

0.1.12

4 years ago

0.1.11

4 years ago

0.1.10

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago