encode-image-stream
v1.0.1
Published
Encode image to base64 string, just encode. ~20 sloc.
Downloads
70
Readme
encode-image-stream
Encode image to base64 string, just encode. ~20 sloc.
Install
npm i encode-image-stream --save
Usage
For more use-cases see the tests
var encodeImageStream = require('encode-image-stream')
var concatStream = require('concat-stream')
fs.createReadStream('./foo.png')
.pipe(encodeImageStream())
.pipe(concatStream(function (buf) {
console.log(buf.toString('utf-8'))
//=> 'iVBORw0KGgoAAAANSUhEUgAAALoAAAA3CAMA ...'
}))
Related
- generate: Project generator, for node.js.
- gulp-micromatch: Filter vinyl files with glob patterns, string, regexp, array, object or matcher function. micromatch stream.
- read-source-stream: Streaming read of local file or remote url.
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.