foldline
v1.1.0
Published
Folds a long line according to the RFC 5322
Downloads
64,119
Maintainers
Readme
foldline
Folds a long line according to the RFC 5322
Note: There are other documents, specifically the MIME documents (RFC 2045, RFC 2046, RFC 2049, RFC 4288, RFC 4289), that extend (and limit) this specification to allow for different sorts of message bodies.
Install via npm
$ npm install --save foldline
Usage
var foldLine = require( 'foldline' )
foldLine(
{String} input,
{Number} maxLength (optional),
{Boolean} hardWrap (optional)
)
Example
foldLine( 'Subject: from x.y.test by example.net via TCP with ESMTP id ABC12345 for <[email protected]>', 30 )
Subject: from x.y.test by<CR><LF>
example.net via TCP with<CR><LF>
ESMTP id ABC12345 for<CR><LF>
<[email protected]>
Tests
$ npm test
Benchmarks
$ npm run benchmark