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

sync-rpc

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sync-rpc - npm Package Compare versions

Comparing version 1.3.5 to 1.3.6

36

lib/__tests__/index.test.js

@@ -10,2 +10,4 @@ const rpc = require('../');

let nativeNCFails = false;
rpc.FUNCTION_PRIORITY.forEach((fn, i) => {

@@ -22,7 +24,33 @@ test('profile ' + fn.name, () => {

} catch (ex) {
console.log(fn.name + ' fails');
if (fn.name === 'nativeNC') {
console.log(fn.name + ' fails');
nativeNCFails = true;
return;
}
throw ex;
}
});
});
rpc.FUNCTION_PRIORITY.forEach((fn, i) => {
test('test 30MB ' + fn.name, () => {
let result;
try {
rpc.configuration.fastestFunction = fn;
result = client('big');
} catch (ex) {
if (fn.name === 'nativeNC' && nativeNCFails) {
console.log(fn.name + ' fails');
return;
}
throw ex;
}
expect(result.length).toBe(30 * 1024 * 1024, 42);
// for (let i = 0; i < 30 * 1024 * 1024, 42; i++) {
// expect(result[i]).toBe(42);
// }
});
});
rpc.FUNCTION_PRIORITY.forEach((fn, i) => {
let longMessage = '';

@@ -42,5 +70,9 @@ for (let i = 0; i < 100000; i++) {

} catch (ex) {
console.log('large ' + fn.name + ' fails');
if (fn.name === 'nativeNC' && nativeNCFails) {
console.log('large ' + fn.name + ' fails');
return;
}
throw ex;
}
});
});

@@ -95,3 +95,7 @@ 'use strict';

function nativeNC(port, input) {
return spawnSync('nc', [host, port], {input: input, windowsHide: true});
return spawnSync('nc', [host, port], {
input: input,
windowsHide: true,
maxBuffer: Infinity,
});
}

@@ -102,5 +106,12 @@

if (src.length < 1000) {
return spawnSync(process.execPath, ['-e', src], {windowsHide: true});
return spawnSync(process.execPath, ['-e', src], {
windowsHide: true,
maxBuffer: Infinity,
});
} else {
return spawnSync(process.execPath, [], {input: src, windowsHide: true});
return spawnSync(process.execPath, [], {
input: src,
windowsHide: true,
maxBuffer: Infinity,
});
}

@@ -107,0 +118,0 @@ }

function init(connection) {
return function(message) {
if (message === 'big') {
return Promise.resolve(Buffer.alloc(30 * 1024 * 1024, 42));
}
return Promise.resolve('sent ' + message + ' to ' + connection);

@@ -4,0 +7,0 @@ };

2

package.json
{
"name": "sync-rpc",
"version": "1.3.5",
"version": "1.3.6",
"main": "lib/index.js",

@@ -5,0 +5,0 @@ "description": "Run asynchronous commands synchronously by putting them in a separate process",

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