Skip to content

dudleycarr/snappystream

Repository files navigation

snappystream

FOSSA Status

A Node.js library for supporting the Snappy framing format via streams. See the Snappy Framing Format Description for details.

Usage: SnappyStream and UnsnappyStream are Transform streams.

const {SnappyStream} = require('snappystream')
const fs = require('fs')

const inStream = fs.createReadStream('snappy.txt')
const snappyStream = new SnappyStream()
const outStream = fs.createWriteStream('snappy_frame.txt')

inStream.pipe(snappyStream).pipe(outStream)

UnsnappyStream constructor takes an optional argument verifyChecksums which is false by default.

const {UnsnappyStream} = require('snappysteam')
const fs = require('fs')

const inStream = fs.createReadStream('snappy_frame.txt')
const unsnappyStream = new UnsnappyStream(true)

unsnappyStream.on('end', function () {
  console.log(unsnappyStream.read())
})

inStream.pipe(unsnappyStream)

License

FOSSA Status

About

JavaScript library for supporting Snappy framing format

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages