Security News
OpenJS: “XZ Utils Cyberattack Likely Not an Isolated Incident”
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.
node-html-light
Advanced tools
Weekly downloads
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,857 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.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.
Company News
Come meet the Socket team at BSidesSF and RSA! We're sponsoring several fun networking events and we would love to see you there.
Security News
OSI is starting a conversation aimed at removing the excuse of the SaaS loophole for companies navigating licensing and the complexities of doing business with open source.