A minimal subset of jsdom, focusing on DOM (and omitting wider Web APIs).
npm install dominimal
// dominimal exports all the same modules as jsdom.
const dominimal = require('dominimal');
const { JSDOM } = dominimal;
const jsdom = new JSDOM('', { pretendToBeVisual: true });
const { document } = jsdom.window;
const body = document.createElement('body');
document.documentElement.appendChild(body);
console.log(jsdom.serialize());