mime-part-stream
v0.4.0
Published
Transform an input stream to a single part of an overall multipart MIME message
Downloads
18
Readme
#MIME Part Stream
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
andquoted-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