Folds a long line according to the RFC 5322
npm install foldlineFolds 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.
[RFC 2045]: http://tools.ietf.org/html/rfc2045
[RFC 2046]: http://tools.ietf.org/html/rfc2046
[RFC 2049]: http://tools.ietf.org/html/rfc2049
[RFC 4288]: http://tools.ietf.org/html/rfc4288
[RFC 4289]: http://tools.ietf.org/html/rfc4289
``sh`
$ npm install --save foldline
`js`
var foldLine = require( 'foldline' )
`js`
foldLine(
{String} input,
{Number} maxLength (optional),
{Boolean} hardWrap (optional)
)
`js`
foldLine( 'Subject: from x.y.test by example.net via TCP with ESMTP id ABC12345 for
``
Subject: from x.y.test by
example.net via TCP with
ESMTP id ABC12345 for
`sh`
$ npm test
`sh``
$ npm run benchmark