0.1.5 • Published 9 years ago

splitweet v0.1.5

Weekly downloads
3
License
-
Repository
github
Last release
9 years ago

Splitweet

A small library for splitting text into tweet size chucks, spliting on spaces and adding ellipsis or any other delimiter

Installation

npm install splitweet --save

Usage

var splitweet = require('splitweet')
ss = splitweet.split;

var long = "Lorem ipsum dolor sit amet, sit an dicat fabellas, ne legere legimus pri. Ad rebum volumus corrumpit vix, tibique urbanitas cu his. Ornatus sententiae an mea. Eum ut quando aeterno, odio nullam labore qui no."

console.log(ss(long, 140, '...'));

This returns

[ 'Lorem ipsum dolor sit amet, sit an dicat fabellas, ne legere legimus pri. Ad rebum volumus corrumpit vix, tibique urbanitas cu his....', 'Ornatus sententiae an mea. Eum ut quando aeterno, odio nullam labore qui no.' ]

Tests

npm test

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

0.1.5

9 years ago

0.1.4

9 years ago

0.1.2

9 years ago