minimum-raggedness-wordwrap

0.0.1 • Public • Published

wordwrap

Minimum raggedness wordwrap algorithm

Usage

import wordwrap from 'wordwrap';
const input = 'Alfred Aho likes to code';
const constraint = 10;
console.log(wordwrap(input, counstraint));

/**
* Current algorithm output:
*
* Alfred
* Aho likes
* to code
*/

/**
* Another greedy algorithm output:
*
* Alfred Aho
* likes to
* code
*/

Package Sidebar

Install

npm i minimum-raggedness-wordwrap

Weekly Downloads

3

Version

0.0.1

License

ISC

Last publish

Collaborators

  • leonovpavel