length-prefixed-stream
Streaming length prefixed buffers
Last updated 6 years ago by mafintosh .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install length-prefixed-stream 
SYNC missed versions from official npm registry.

length-prefixed-stream

Streaming equivalent of length-prefixed-message. This module allow you to send buffers with a varint length prefix to ensure that they will arrive unpartioned

npm install length-prefixed-stream

build status

Usage

var lpstream = require('length-prefixed-stream')

var encode = lpstream.encode() // create an encode stream to send data
var decode = lpstream.decode() // create an decode stream to receive data

encode.write('hello world') // send "hello world"

decode.on('data', function(data) {
  console.log(data.toString()) // will always print "hello world"
})

encode.pipe(decode) // for testing just pipe to our selves

API

transformStream = lpstream.encode()

Creates a new encoder transform stream.

transformStream = lpstream.decode()

Creates a new decoder transform stream.

License

MIT

Current Tags

  • 2.0.0                                ...           latest (6 years ago)

13 Versions

  • 2.0.0                                ...           6 years ago
  • 1.6.0                                ...           6 years ago
  • 1.5.2                                ...           7 years ago
  • 1.5.1                                ...           8 years ago
  • 1.5.0                                ...           9 years ago
  • 1.4.0                                ...           9 years ago
  • 1.3.2                                ...           9 years ago
  • 1.3.1                                ...           9 years ago
  • 1.3.0                                ...           9 years ago
  • 1.2.0                                ...           9 years ago
  • 1.1.0                                ...           10 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (5)

Copyright 2013 - present © cnpmjs.org | Home |