Licence
MIT
Version
0.0.4
Deps
0
Vulns
0
Weekly
0
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);