cssax
Event-based CSS querying of HTML streams.
Last updated 6 years ago by tcr .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install cssax 
SYNC missed versions from official npm registry.

CSS Querying Sax Parser

For HTML/XML.

npm install cssax

Then:

var cssax = require('../cssax');

var stream = cssax.createStream();
stream.query('title').on('match', function (tag, attributes) {
  this.readText(function (text) {
    console.log(JSON.stringify(text));
  });
});

require('fs').createReadStream('file.html').pipe(stream);

Supported selectors:

  • *
  • E
  • E F
  • E > F
  • E + F
  • E ~ F
  • E.class
  • E#id
  • E[attr]
  • E[attr=value]
  • E[attr*=value]
  • E[attr^=value]
  • E[attr$=value]
  • E[attr|=value]
  • E[attr~=value]
  • E:nth-child(an+b)

Current Tags

  • 0.0.8                                ...           latest (6 years ago)

8 Versions

  • 0.0.8                                ...           6 years ago
  • 0.0.7                                ...           6 years ago
  • 0.0.6                                ...           7 years ago
  • 0.0.5                                ...           7 years ago
  • 0.0.4                                ...           8 years ago
  • 0.0.3                                ...           8 years ago
  • 0.0.2                                ...           8 years ago
  • 0.0.1                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 4
Last Day 0
Last Week 1
Last Month 5
Dependencies (2)
Dev Dependencies (0)
None
Dependents (2)

Copyright 2014 - 2016 © taobao.org |