metaparser
A Cheerio helper library for my Node.js automation modules
Last updated 9 years ago by haydenbleasel .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ npm install metaparser 
SYNC missed versions from official npm registry.

Metaparser Build Status

A Cheerio helper library for my Node.js automation modules. Installed through NPM with:

npm install metaparser --save-dev

Simply require the module and execute it with an optional array of configuration.

  • Source: HTML file to write to.
  • Add: String, Array or Object of elements to add (literal elements)
  • Remove: String, Array or Object of elements to remove (pseudo selectors)
  • Callback: Function to execute upon completion (parameters are 'error' and 'html').

Defaults are shown below:

var metaparser = require('metaparser');
metaparser({
    source: null,
    add: null,
    remove: null,
    out: null,
    callback: null
});

Example usage:

metaparser({
    source: 'test/index.html',
    add: '<link rel="author" href="humans.txt" />',
    remove: 'link[rel="author"]',
    out: 'test/index2.html',
    callback: function (error, data) {
        console.log(error, data);
    }
});

Data can be provided directly:

metaparser({
    data: '<html><head><meta name="author" content="Superman"></head></html>',
    add: '<link rel="author" href="humans.txt" />',
    remove: 'link[rel="author"]',
    out: 'test/index2.html',
    callback: function (error, data) {
        console.log(error, data);
    }
});

Current Tags

  • 1.0.7                                ...           latest (9 years ago)

8 Versions

  • 1.0.7                                ...           9 years ago
  • 1.0.6                                ...           9 years ago
  • 1.0.5                                ...           10 years ago
  • 1.0.4                                ...           10 years ago
  • 1.0.3                                ...           10 years ago
  • 1.0.2                                ...           10 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (0)
None
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE