Skip to content

Instantly share code, notes, and snippets.

Avatar

Joviano Dias joviano-dias-springernature

  • London
View GitHub Profile
@joviano-dias-springernature
joviano-dias-springernature / json-to-html-table.js
Last active Nov 20, 2020
Create HTML table from JSON using node-json2html
View json-to-html-table.js
const json2html = require('node-json2html');
const fs = require('fs-extra')
let template_table_header = {
"<>": "tr", "html": [
{"<>": "th", "html": "App Name"},
{"<>": "th", "html": "Accessibility"},
{"<>": "th", "html": "Best Practices"},
{"<>": "th", "html": "SEO"},
{"<>": "th", "html": "Performance"}
View gist:eed1ab15d23096d6c7b8549b1fe4bcd7
const chromeLauncher = require('chrome-launcher');
const puppeteer = require('puppeteer');
const lighthouse = require('lighthouse');
const config = require('lighthouse/lighthouse-core/config/lr-desktop-config.js');
const reportGenerator = require('lighthouse/lighthouse-core/report/report-generator');
const request = require('request');
const util = require('util');
const fs = require('fs');
const sleep = seconds =>
new Promise(resolve => setTimeout(resolve, (seconds || 1) * 1000));
@joviano-dias-springernature
joviano-dias-springernature / Lighthouse-Puppeteer.js
Last active Nov 20, 2020
Run a lighthouse scan using puppeteer
View Lighthouse-Puppeteer.js
const chromeLauncher = require('chrome-launcher');
const puppeteer = require('puppeteer');
const lighthouse = require('lighthouse');
const config = require('lighthouse/lighthouse-core/config/lr-desktop-config.js');
const reportGenerator = require('lighthouse/lighthouse-core/report/report-generator');
const request = require('request');
const util = require('util');
const fs = require('fs');
(async() => {
You can’t perform that action at this time.