JSPM

foldline

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 26600
  • Score
    100M100P100Q150880F
  • License MIT

Folds a long line according to the RFC 5322

Package Exports

  • foldline

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (foldline) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

foldline

npm npm license npm downloads build status

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 <mary@example.net>', 30 )
Subject: from x.y.test by<CR><LF>
  example.net via TCP with<CR><LF>
  ESMTP id ABC12345 for<CR><LF>
  <mary@example.net>

Tests

$ npm test

Benchmarks

$ npm run benchmark