
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
html-document
Advanced tools
Partial implementation of the DOM, document for node.
import Document from 'html-document'; // or var Document = require('html-document');
const document = new Document();
let textNode = document.createTextNode('Hello');
let h1 = document.createElement('h1');
h1.setAttribute('id', 'title');
h1.appendChild(textNode);
expect(h1.outerHTML, '<h1 id="title">Hello</h1>');
The partial implementation allows you to build html like you would in the browser, with the DOM API.
This library will never implement all specifications of the W3C.
See the generated API here.
Inject window
, document
, Document
, DocumentFragment
, Node
and Event
in the global scope.
import 'html-document/lib/global'; // or var Document = require('html-document/lib/global');
let textNode = document.createTextNode('Hello');
expect(textNode.textContent, 'Hello');
Create an HTML layout
let document = new Document();
let fragment = document.createDocumentFragment();
fragment.appendChild(new Doctype());
let html = document.createElement('html');
fragment.appendChild(html);
let head = document.createElement('head');
html.appendChild(head);
let body = document.createElement('body');
html.appendChild(body);
expect(fragment.innerHTML, '<!DOCTYPE html><html><head></head><body></body></html>');
v0.8.1
Update springbokjs-library
FAQs
Partial implementation of document, HTMLElement for node
We found that html-document demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.