0.0.4 • Published 8 years ago

truncator-js v0.0.4

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

truncator-js

Truncate text to the nearest word of a limit

Install

With yarn:

$ yarn add truncator-js

With npm:

$ npm install --save truncator-js

Usage

const truncate = require('truncator-js');

// The function takes two arguments.
// The first is the selector you want to truncate using a '.classname' string.
// The second is the character limit that you wish to truncate on.

// truncate(selector, charLimit)

// Example
truncate('div.shortened', 100);