Base64 encode/decode stream.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
UNLICENSE
index.es6.js
package.json
test.js

README.md

stream64 npm version

Base64 encode/decode stream.

Example

const Stream = require('stream')
const stream64 = require('stream64')

const stream = () => {
  const s = new Stream.Readable()
  s._read = () => {}
  return s
}

const s1 = stream()
s1.pipe(stream64.encode()).pipe(process.stdout)
s1.push('Hello, ') // 'Hello,' -> SGVsbG8s
s1.push('world\n') // ' world' -> IHdvcmxk
s1.push(null) // '!\n' -> IQo=

const s2 = stream()
s2.pipe(stream64.decode()).pipe(process.stdout)
s2.push('SGVsbG8sIHd') // SGVsbG8s -> 'Hello,'
s2.push('vcmxkIQo=') // IHdvcmxkIQo= -> ' world!\n'
s2.push(null)