post-split

0.0.5 • Public • Published

post-split

build status

Split a post (status, tweet) up into human-readable segments that fit inside a specific length.

Usage

The following assumes this:

var ps = require('post-split');

var post = 'Hello world, this is a long post that I wish to be split into many sub-posts. It\'s long, which is useful becuse it needs to be. Longer and longer it goes. Yes.';

Extract segments from a post:

var segments = ps.segments(post, 50);

/*
segments =
[ 'Hello world, this is a long post that I wish to',
  ' be split into many sub-posts. It\'s long, which',
  ' is useful becuse it needs to be. Longer and',
  ' longer it goes. Yesh.' ]
 */

With a longer segment length:

 var segments = ps.segments(post, 70);

/*
 segments =
[ 'Hello world, this is a long post that I wish to be split into many',
  ' sub-posts. It\'s long, which is useful becuse it needs to be. Longer',
  ' and longer it goes. Yesh.' ]
  */

Install

npm install post-split

License

MIT

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i post-split

    Weekly Downloads

    0

    Version

    0.0.5

    License

    MIT

    Last publish

    Collaborators

    • tgvashworth