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

packet-stream-codec

Package Overview
Dependencies
Maintainers
17
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

packet-stream-codec - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

pnpm-lock.yaml

6

index.js

@@ -16,3 +16,3 @@

var head = new Buffer(9)
var head = Buffer.alloc(9)
var flags = 0

@@ -29,3 +29,3 @@ var value = msg.value !== undefined ? msg.value : msg.end

flags = STRING
value = new Buffer(value)
value = Buffer.from(value, 'utf-8')
}

@@ -37,3 +37,3 @@ else if(isBuffer(value)) {

flags = OBJECT
value = new Buffer(JSON.stringify(value))
value = Buffer.from(JSON.stringify(value), 'utf-8')
}

@@ -40,0 +40,0 @@

{
"name": "packet-stream-codec",
"description": "binary codec for packet-stream",
"version": "1.1.2",
"version": "1.1.3",
"homepage": "https://github.com/dominictarr/packet-stream-codec",

@@ -19,4 +19,7 @@ "repository": {

},
"engines": {
"node": ">=5.10.0"
},
"scripts": {
"prepublish": "npm ls && npm test",
"prepublish": "npm test",
"test": "set -e; for t in test/*.js; do node $t; done"

@@ -23,0 +26,0 @@ },

@@ -20,8 +20,8 @@

{req: 1, stream: false, end: false, value: 'whatever'}, //a request
{req: 2, stream: true, end: false, value: new Buffer('hello')}, //a stream packet
{req: -2, stream: true, end: false, value: new Buffer('goodbye')}, //a stream response
{req: 2, stream: true, end: false, value: Buffer.from('hello', 'utf-8')}, //a stream packet
{req: -2, stream: true, end: false, value: Buffer.from('goodbye', 'utf-8')}, //a stream response
{req: -3, stream: false, end: true, value: flat(new Error('intentional'))},
{req: 2, stream: true, end: true, value: true}, //a stream packet
{req: -2, stream: true, end: true, value: true}, //a stream response
{req: 1, stream: false, end: false, value: new Buffer(1024*1024)}, //a large buffer
{req: 1, stream: false, end: false, value: Buffer.alloc(1024*1024)}, //a large buffer
"GOODBYE"

@@ -28,0 +28,0 @@ ]

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