Socket
Socket
Sign inDemoInstall

metaparser

Package Overview
Dependencies
31
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    metaparser

A Cheerio helper library for my Node.js automation modules


Version published
Weekly downloads
6.8K
decreased by-16.21%
Maintainers
1
Install size
2.31 MB
Created
Weekly downloads
 

Readme

Source

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);
    }
});

Keywords

FAQs

Last updated on 06 Nov 2015

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc