linrock / snapshot-url

A node.js library for rendering HTML from URLs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

snapshot-url

A node.js library for rendering HTML from URLs after loading assets on the page (images, javascript).

Lightweight wrappers around:

Example usage:

const { Snapshot } = require('snapshot-url');

const url = 'file:///tmp/build/index.html';
const snapshot = new Snapshot(url);
const dom = await snapshot.renderDOM();
  
const document = dom.window.document;
const finalHtml = snapshot.getHtml({ prettyPrint: true });

License

MIT

About

A node.js library for rendering HTML from URLs


Languages

Language:JavaScript 98.3%Language:HTML 1.1%Language:CSS 0.6%