mime-part-stream

0.4.0 • Public • Published

MIME Part Stream

Travis CI Test Status

Pipe data in to this transform stream and receive an encoded MIME part for a multipart MIME block.

npm install mime-part-stream

To use:

var mimePartStream = require('mime-part-stream');
fs.createReadStream('logo.png').pipe(mimePartStream({
  type: 'image/png',
  transferEncoding: 'base64'
}).pipe(res);

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

  • type: this should be a valid MIME type eg. 'text/plain; charset=UTF-8' or 'application/pdf'
  • transferEncoding: base64 and quoted-printable are the 2 available options; defaults to no encoding
  • headers: optional object containing header key value pairs

Note that you should append '; charset=UTF-8' with any text/ MIME-types

Readme

Keywords

Package Sidebar

Install

npm i mime-part-stream

Weekly Downloads

3

Version

0.4.0

License

none

Last publish

Collaborators

  • connrs