html-preview

1.0.0 • Public • Published

html-preview

Build Status

Trim down an HTML string to a specific length.

Useful for creating previews for APIs which you can't control (e.g. RSS feeds)

Install

$ npm install --save html-preview

Usage

const preview = require('html-preview');
 
const html = '<span>text1</span><span>test2</span><span>test3</span>';
const limit = 10;
 
preview(html, limit); //=> '<span>text1</span><span>test2</span>'

License

MIT © ewnd9

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    337
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    337

Package Sidebar

Install

npm i html-preview

Weekly Downloads

337

Version

1.0.0

License

MIT

Last publish

Collaborators

  • ewnd9