shirakaba / dominimal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dominimal

A minimal subset of jsdom, focusing on DOM (and omitting wider Web APIs).

Installation

npm install dominimal

Usage

// 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());

About

License:MIT License


Languages

Language:JavaScript 99.0%Language:Shell 0.6%Language:TypeScript 0.5%