Create a readable stream composed of multipart parts of an overall MIME multipart section
JavaScript Vim script
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
.vimrc
LICENCE
README.md
package.json

README.md

#MIME Multipart Stream

Travis CI Test Status

Creates a readable stream composed of multiple MIME parts to be injected into an overall email

npm install mime-multipart-stream

To use:

var stream = mimeMultipartStream({
  boundary: '1234567890',
  type: 'alternative'
});
stream.add({
  type: 'text/plain; charset=UTF-8',
  transferEncoding: 'quoted-printable',
  body: textPlainStream
});
stream.add({
  type: 'text/html; charset=UTF-8',
  transferEncoding: 'quoted-printable',
  body: textHtmlStream
});

When initialising a new stream, there are 2 options available in the options object:

  • type: This should be one of the valid multipart subtypes eg. mixed, alternative.
  • boundary: This should be a an ASCII boundary string that is used to generate the MIME separators between each MIME part.

Once you have created your stream, use the add method to add multiple readable streams. Each stream is added using the initialisation options found in the mime-part-stream (GitHub) module.

Once ready, use the standard readable streams API to consume the content.