Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
node-html-light
Advanced tools
Readme
HTML Parser for NodeJS providing a lightweight object oriented interface
npm i node-html-light --save
blauspecht.io uses node-html-light
to render their whole page server-side. blauspecht.io enables you to provide rich content to your followers, schedule tweets and threads and will add AI-powered features soon.
const Document = require('node-html-light').Document
const resolve = require('path').resolve
Document.fromPath(resolve('./index.html')).then((document) => {
// head is an instance of Node
const head = document.head()
// body is an instance of Node
const body = document.body()
// find child elements
// append child elements
// remove child elements
// replace child elements
return document.toHtml()
}).then((html) => {
// ..
})
const Node = require('node-html-light').Node
const resolve = require('path').resolve
Node.fromPath(resolve('partial.html')).then((node) => {})
const Node = require('node-html-light').Node
const node = Node.fromString('<div></div>')
const Node = require('node-html-light').Node
const Attributes = require('node-html-light').Attributes
const node = Node.of('meta', Attributes.of({
'name': 'viewport',
'theme-color': '#795548'
})
)
const Node = require('node-html-light').Node
const Attributes = require('node-html-light').Attributes
const resolve = require('path').resolve
Node.fromPath(resolve('partial.html')).then((node) => {
const content = node.find('div', Attributes.of({
'name': 'viewport',
'theme-color': '#795548'
}))
})
This project is distributed under the MIT license.
FAQs
HTML Parser for NodeJS providing a lightweight object oriented interface
The npm package node-html-light receives a total of 2,620 weekly downloads. As such, node-html-light popularity was classified as popular.
We found that node-html-light 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.