All Projects → litejs → dom-lite

litejs / dom-lite

Licence: other
A small DOM library for server-side testing, rendering, and handling of HTML files

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to dom-lite

Phpstamp
The XSL-way templating library for MS Office Word DOCX documents.
Stars: ✭ 150 (+733.33%)
Mutual labels:  dom, document
Unfetch
🐕 Bare minimum 500b fetch polyfill.
Stars: ✭ 5,239 (+29005.56%)
Mutual labels:  xmlhttprequest
Respo
A virtual DOM library built with ClojureScript, inspired by React and Reagent.
Stars: ✭ 230 (+1177.78%)
Mutual labels:  dom
Swiftsoup
SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS)
Stars: ✭ 3,079 (+17005.56%)
Mutual labels:  dom
Lunasvg
A standalone c++ library to create, animate, manipulate and render SVG files.
Stars: ✭ 243 (+1250%)
Mutual labels:  dom
ajax
Ajax wrapper for nim js backend
Stars: ✭ 18 (+0%)
Mutual labels:  xmlhttprequest
Lite Virtual List
Virtual list component library supporting waterfall flow based on vue
Stars: ✭ 223 (+1138.89%)
Mutual labels:  dom
guide
Maintenance Guidelines for GitHub/npm organization.
Stars: ✭ 12 (-33.33%)
Mutual labels:  document
minireq
A minimal request library for the browser
Stars: ✭ 42 (+133.33%)
Mutual labels:  xmlhttprequest
React Scroll Sync
Synced scroll position across multiple scrollable elements
Stars: ✭ 252 (+1300%)
Mutual labels:  dom
React Tilt
👓 Parallax tilt hover effect for React JS - tilt.js
Stars: ✭ 254 (+1311.11%)
Mutual labels:  dom
Browser Sec Whitepaper
Cure53 Browser Security White Paper
Stars: ✭ 251 (+1294.44%)
Mutual labels:  dom
cypress-upload-file-post-form
Solution for two Cypress testing use-cases I came across with: perform a direct http FORM request to the server containing a file and other parameters and upload a file into a form before submission
Stars: ✭ 59 (+227.78%)
Mutual labels:  xmlhttprequest
Skrape.it
A Kotlin-based testing/scraping/parsing library providing the ability to analyze and extract data from HTML (server & client-side rendered). It places particular emphasis on ease of use and a high level of readability by providing an intuitive DSL. It aims to be a testing lib, but can also be used to scrape websites in a convenient fashion.
Stars: ✭ 231 (+1183.33%)
Mutual labels:  dom
html-parser
A simple and general purpose html/xhtml parser, using Pest.
Stars: ✭ 56 (+211.11%)
Mutual labels:  dom
Pugixml
Light-weight, simple and fast XML parser for C++ with XPath support
Stars: ✭ 2,809 (+15505.56%)
Mutual labels:  dom
Disintegrate
A small JS library to break DOM elements into animated Canvas particles.
Stars: ✭ 251 (+1294.44%)
Mutual labels:  dom
XMLHTTPRequest
An implementation of the JavaScript XMLHTTPRequest object to extend JavaScriptCore.
Stars: ✭ 63 (+250%)
Mutual labels:  xmlhttprequest
hypercomponent
⚡ Fast and light component system, backed by hyperHTML
Stars: ✭ 45 (+150%)
Mutual labels:  dom
k-box
Web-based application to manage documents, images, videos and geodata.
Stars: ✭ 28 (+55.56%)
Mutual labels:  document

LiteJS DOM – Coverage Size Buy Me A Tea

A small DOM library for server-side testing, rendering, and handling of HTML files.

Examples

const { document, DOMParser, XMLSerializer } = require("@litejs/dom");
const { XMLHttpRequest } = require("@litejs/dom/net");

// Use XMLHttpRequest in server side
var xhr = new XMLHttpRequest()
xhr.open("GET", "https://litejs.com")
xhr.responseType = "document"
xhr.onload = function() {
	var doc = xhr.responseXML
	// Work with DOM in familiar way
	console.log(doc.querySelector("title").textContent)
}
xhr.send()

// Build DOM manually
const el = document.createElement("h1");
el.id = 123;
el.className = "large";

const fragment = document.createDocumentFragment();
const text1 = document.createTextNode("hello");
const text2 = document.createTextNode(" world");

fragment.appendChild(text1);
fragment.appendChild(text2);
el.appendChild(fragment);

el.innerHTML;
// hello world
el.innerHTML = "<b>hello world</b>";
el.toString();
// <h1 id="123" class="large"><b>hello world</b></h1>

// minify output
el.toString(true);
// <h1 id=123 class=large><b>hello world</b></h1>

el.querySelectorAll("b");
// [ "<b>hello world</b>" ]

Contributing

Follow Coding Style Guide

Run tests

npm install
npm test

External links

GitHub repo | npm package | DOM spec | Selectors Level 3 | Coveralls coverage
Buy Me A Tea

Licence

Copyright (c) 2014-2023 Lauri Rooden <[email protected]>
The MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].