encode-image-stream

1.0.1 • Public • Published

encode-image-stream npmjs.com The MIT License

Encode image to base64 string, just encode. ~20 sloc.

code climate standard code style travis build status coverage status dependency status

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.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckocore.tk keybase tunnckocore tunnckoCore npm tunnckoCore twitter tunnckoCore github

Package Sidebar

Install

npm i encode-image-stream

Weekly Downloads

14

Version

1.0.1

License

MIT

Last publish

Collaborators

  • vanchoy
  • tunnckocore