Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

length-prefixed-stream

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

length-prefixed-stream - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

.travis.yml

2

decode.js

@@ -42,3 +42,3 @@ var varint = require('varint')

if (missing <= free) { // fast track - no copy
this._push(data.slice(offset, missing))
this._push(data.slice(offset, offset+missing))
return offset+missing

@@ -45,0 +45,0 @@ }

{
"name": "length-prefixed-stream",
"version": "1.0.0",
"version": "1.0.1",
"description": "Streaming length prefixed buffers",

@@ -10,2 +10,3 @@ "main": "index.js",

"devDependencies": {
"concat-stream": "^1.4.6",
"tape": "^2.14.0",

@@ -12,0 +13,0 @@ "through2": "^0.6.1"

@@ -10,2 +10,4 @@ # length-prefixed-stream

[![build status](http://img.shields.io/travis/mafintosh/length-prefixed-stream.svg?style=flat)](http://travis-ci.org/mafintosh/length-prefixed-stream)
## Usage

@@ -12,0 +14,0 @@

var tape = require('tape')
var through = require('through2')
var concat = require('concat-stream')
var lpstream = require('./')

@@ -30,2 +31,19 @@

tape('buffered encode -> buffered decode', function(t) {
var e = lpstream.encode()
var d = lpstream.decode()
d.on('data', function(data) {
t.same(data.toString(), 'hello world')
t.end()
})
e.write('hello world')
e.end()
e.pipe(concat(function(data) {
d.end(data)
}))
})
tape('encode -> decode twice', function(t) {

@@ -32,0 +50,0 @@ t.plan(2)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc