package
Folds a long line according to the RFC 5322
npm install foldlineGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 1 packages.
7.2 kB
Includes dependencies.
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.
$ npm install --save foldlinevar foldLine = require( 'foldline' )foldLine( 'Subject: from x.y.test by example.net via TCP with ESMTP id ABC12345 for <mary@example.net>', 30 )'Subject: from x.y.test by \r\n' +
' example.net via TCP with \r\n' +
' ESMTP id ABC12345 for \r\n' +
' <mary@example.net>'foldLine.DEFAULT_LINE_LENGTH = 78foldLine.MIN_LINE_LENGTH = 1foldLine.MAX_LINE_LENGTH = 998foldLine( value[, maxLength[, minLength]] )value: String to be foldedmaxLength: Maximum line length (excluding <CRLF>).foldLine.DEFAULT_LINE_LENGTH (78).minLength: Minimum line length (excluding <CRLF>).maxLength / 3.Returns string
foldLine.unfold( value )value: String to be unfoldedReturns string
$ npm test