remark-word-wrap

Wrap lines of Markdown to a specified width.
With npm do:
npm install remark-word-wrap
var remark = require('remark');
var wrap = require('remark-word-wrap');
var markdown = 'Hello, world!';
var result = remark().use(wrap, {width: 5}).process(markdown);
Output:
Hello,
world!
Add extra line breaks to paragraph
nodes to ensure that they fit to a
specified width.
Type: string
Default: ''
(empty)
Prepend this string to the start of each line.
Type: string
Default: \n
Append this string to the end of each line.
Type: number
Default: 72
The maximum length of the line. Note that this does not include additional characters from elements like lists.
Pull requests are welcome. If you add functionality, then please add unit tests to cover it.
MIT © Ben Briggs