packet-stream-codec
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -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 @@ ] |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10939
7
1