@lydio/dom
v3.0.1
Published
Document object scaffold for Lydio
Downloads
8
Maintainers
Readme
@lydio/dom
Canonical URL:
https://alexstevovich.com/a/lydio-dom-nodejs
Software URL:
https://midnightcitylights.com/software/lydio-dom-nodejs
Document scaffold node for Lydio.
@lydio/dom provides a complete document structure for Lydio, including
a <!DOCTYPE html> declaration and the standard <html>, <head>, and <body> elements.
It’s a minimal base for any programmatically generated HTML document.
Installation
npm install @lydio/domExample
import Dom from '@lydio/dom';
const dom = new Dom();
dom.html.head.addTag('title').withText('Example Page');
dom.html.body.addTag('p').withText('Hello, world!');
console.log(dom.toHtml());
/*
<!DOCTYPE html><html><head><title>Example Page</title></head><body><p>Hello, world!</p></body></html>
*/Features
- Adds a valid !DOCTYPE html declaration automatically.
- Includes html, head, and body structure out of the box.
- Lightweight foundation for building full semantic documents.
License
Licensed under the Apache License 2.0.
Trademark
“Lydio” and related marks are trademarks of Alex Stevovich.
See TRADEMARK.md for details.
