Skip to content

make automatic pixel perfect screenshots built using Node.js & puppeteer

License

Notifications You must be signed in to change notification settings

robertsaupe/node-screenshots

Repository files navigation

node-screenshots - make automatic pixel perfect screenshots

Supporting | License | Installing | Getting started | Updating | Credits

Supporting

GitHub | Patreon | PayPal | Amazon

License

This software is distributed under the MIT license. Please read LICENSE for information.

Installing

Requirements

Installing Requirements on Windows

Installing Chocolatey (Package Manager for Windows) [Recommended, Optional]

First, ensure that you are using an administrative shell - you can also install as a non-admin, check out Non-Administrative Installation.

Install with powershell.exe

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

Other install methods can be found here.

Installing NVM for Windows

choco install nvm

or

Download and install nvm-setup.exe from releases

Installing Node.js Version using NVM for Windows

$nvmrc = Get-Content .nvmrc
Invoke-Expression -Command "nvm install $nvmrc"
Invoke-Expression -Command "nvm use $nvmrc"

PowerShell Startup Script for .nvmrc

Create a profile file
New-item –type file –force $profile
edit the created profile file and add
Function runNvmUse([string]$version) {
    Invoke-Expression -Command "nvm use $version"
}
if (Test-Path .nvmrc) {
    $nvmrc = Get-Content .nvmrc
    $project_version = "v$nvmrc"
    $current_version = Invoke-Expression -Command "node -v"
    if ($project_version -ne $current_version) {
        runNvmUse($nvmrc)
    } else {
        Write-Output "Already using node $current_version"
    }
}

Environment

git clone https://github.com/robertsaupe/node-screenshots.git
cd node-screenshots/
npm install

Getting started

modify example.js or create your own

then simple run:

node example.js

you can find screenshots in ./screenshots/

Updating

Updating Dependencies

npm install -g npm-check-updates
ncu -u
npm install

Credits