UNPKG

324 BMarkdownView Raw
1# CSS Querying Sax Parser
2
3For HTML/XML.
4
5```
6var cssax = require('../cssax');
7
8var stream = cssax.createStream();
9stream.query('title').on('match', function (tag, attributes) {
10 this.readText(function (text) {
11 console.log(JSON.stringify(text));
12 });
13});
14
15require('fs').createReadStream('file.html').pipe(stream);
16```