

The source can be found at and the working version checked out at. The screenshot.png should be on the directory that you run the node offline-login-check.js command.

I used apidoc to create the documentation inline of my code, once I build the documentation it is available under /docs ( preview). It is very simple and consists of two endpoints: /api/shot and /api/pdf. We are using yargs-parser to convert our CLI arguments into something useful. Puppeteer ready docker environment, last version of puppeteer, chrome, Chromium and nodejs.
#Puppetteer screenshot path install#
I decided to spawn up a simple NodeJS service with ExpressJS. Create a new project, jump in to initialise it and install the following: mkdir puppeteer-katex cd puppeteer-katex begin project with basic settings yarn init -y yarn add puppeteer yargs-parser. You can automate many tasks with Puppeteer, one of them being taking screenshots. When you install Puppeteer, it downloads a recent version of Chromium (170MB Mac, 282MB Linux, 280MB Win) that is guaranteed to work with the API. The basics - a simple NodeJS application spawning a puppeteer controlled headless browser to capture screenshots and images from a website - where already in place, but now I wanted to make it a bit more versatile and consumable. Puppeteer runs headless by default, but can be configured to run full (non-headless) Chrome or Chromium. I could have created a simple NodeJS application ( like described in this article) just to solve the problem at a time but thought: “Why do I not make it a simple service?”. As a developer I wanted to create a simple service which creates dynamic websites and have them easily sharable via screenshots and PDF.
