Pop Tags

HTML Module

var html = require("html");

The HTML Module works similar to the XML module, it lets you easily handle HTML with a jQuery-like syntax.

The module exports a single method, html.parse(string), that will return a parsed html document.

You can call the following methods on the document object nodes returned by .parse()

.find(".example") - returns node(s) with the matching the CSS selector

.name() - returns the name of a node

.text() - returns text contents of a node

.html() - returns the html of a node

.remove() - removes a node 

node.replaceWith(somehtml) - replace a node with the html you pass in

Continue to Storage Module »