Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (20 sloc) 0.689 kB

node-stripr

Node.js Script for stripping content

Installation

$ npm install node-stripr

Usage Example

var stripr = require('node-stripr');

var strippedContent = stripr('<html><head><title>Test</title></head><body>Hello World</body></html>');
// strippedContent = 'Hello World'

// You can also add custom stripping rules:

var customStrippingRules = {
  // key: identifier<string>, value: stripping regex<regex>
  // e.g. strip a footer
  '<footer': /<footer(?:.|\n|\r)+?(<\/footer>|\/>)/i
};

stripr('<html><head><title>Test</title></head><body>Hello World<footer>No way</footer></body></html>', customStrippingRules);
// returns 'Hello World' again ;)
Jump to Line
Something went wrong with that request. Please try again.