Skip to content

Instantly share code, notes, and snippets.

@alexp1917
alexp1917 / index.js
Created August 1, 2021 22:51 — forked from benoitv-code/index.js
d3, jsdom, node.js: server-side rendering
// Instructions:
// npm install --save d3 jsdom
const fs = require('fs');
const d3 = import('d3');
const jsdom = require('jsdom');
const { JSDOM } = jsdom;
async function main() {
const fakeDom = new JSDOM('<!DOCTYPE html><html><body></body></html>');