Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
A small DOM implementation for testing, server-side rendering and working with html files.
const { document, DOMParser, XMLSerializer } = require("dom-lite");
const { XMLHttpRequest } = require("dom-lite/xmlhttprequest");
// 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>" ]
Follow Coding Style Guide
Run tests
npm install
npm test
GitHub repo |
npm package |
DOM spec |
Selectors Level 3 |
Coveralls coverage
Buy Me A Tea
Copyright (c) 2014-2023 Lauri Rooden <lauri@rooden.ee>
The MIT License
FAQs
A small DOM implementation for server-side
The npm package dom-lite receives a total of 46 weekly downloads. As such, dom-lite popularity was classified as not popular.
We found that dom-lite 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.