Socket
Socket
Sign inDemoInstall

grpc-server-js

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grpc-server-js - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

26

lib/handler.js

@@ -29,12 +29,5 @@ 'use strict';

_read (size) {
if (this.finished) {
this.push(null);
}
this.call.resume();
}
_terminate () {
this.finished = true;
this.on('data', noop);
}
deserialize (input) {

@@ -122,9 +115,4 @@ if (input === null || input === undefined) {

ServerReadableStream.prototype.deserialize;
ServerDuplexStream.prototype._terminate =
ServerReadableStream.prototype._terminate;
function noop () {}
function sendMetadata (responseMetadata) {

@@ -156,12 +144,10 @@ return this[kCall].sendMetadata(responseMetadata);

function setUpReadable (stream) {
stream.finished = false;
const decoder = new StreamDecoder();
stream.once('cancelled', () => {
stream._terminate();
stream.destroy();
});
stream.decoder = new StreamDecoder();
stream.call.on('data', async (data) => {
const message = stream.decoder.write(data);
const message = decoder.write(data);

@@ -175,3 +161,5 @@ if (message === null) {

stream.push(deserialized);
if (!stream.push(deserialized)) {
stream.call.pause();
}
} catch (err) {

@@ -178,0 +166,0 @@ err.code = Status.INTERNAL;

@@ -278,3 +278,3 @@ 'use strict';

function respond (err, value, trailer, flags) {
stream._terminate();
stream.destroy();
call.sendUnaryMessage(err, value, trailer, flags);

@@ -281,0 +281,0 @@ }

{
"name": "grpc-server-js",
"version": "0.1.1",
"version": "0.1.2",
"description": "Pure JavaScript gRPC Server",

@@ -5,0 +5,0 @@ "author": "Colin J. Ihrig <cjihrig@gmail.com> (http://www.cjihrig.com/)",

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