Skip to content

ewnd9/html-preview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Trim down an HTML string to a specific length.

Resources

Stars

Watchers

Forks

Packages

No packages published