Socket
Socket
Sign inDemoInstall

brolly

Package Overview
Dependencies
227
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.2.0

examples/wait.js

3

bin/index.js

@@ -36,4 +36,5 @@ 'use strict';

const fn = bench.toString();
const worker = path.resolve(__dirname, './worker');
return fork(path.resolve(__dirname, './worker'), [], { silent: false }).send({ iterations, libraries, fn }).catch(err => {
return fork(worker).send({ iterations, libraries, fn }).catch(err => {
console.log(`error in "${bench.name}"`);

@@ -40,0 +41,0 @@ console.log(err);

@@ -30,3 +30,5 @@ 'use strict';

if (typeof val === 'string') {
return require(val);
try {
return require(val);
} catch (err) {}
}

@@ -36,2 +38,4 @@ return val;

console.log(inject);
let sum = 0;

@@ -38,0 +42,0 @@

@@ -0,11 +1,16 @@

const path = require('path')
const delay = require('delay')
const wait = path.resolve(__dirname, './wait')
const benchmark = require('../src')
const bench = benchmark('timeout', [
[4000, function timeout (time, done) {
[1000, function timeout (time, done) {
setTimeout(done, time)
}],
[wait, function timeout (wait, done) {
wait(done, 2000)
}],
['delay', function delay (delay) {
return delay(2000)
return delay(3000)
}]

@@ -12,0 +17,0 @@ ])

{
"name": "brolly",
"version": "1.1.0",
"version": "1.2.0",
"description": "benchmark in style",

@@ -5,0 +5,0 @@ "main": "bin/index.js",

@@ -8,4 +8,4 @@ # brolly

- forks each bench function as child process
- pass node modules dependencies to bench functions
- pass serialisable values to bench functions
- pass module dependencies to bench functions
- pass serialisable values

@@ -12,0 +12,0 @@ ## Install

@@ -38,4 +38,5 @@ 'use strict'

const fn = bench.toString()
const worker = path.resolve(__dirname, './worker')
return fork(path.resolve(__dirname, './worker'), [], {silent:false})
return fork(worker)
.send({iterations, libraries, fn})

@@ -42,0 +43,0 @@ .catch((err) => {

@@ -30,3 +30,5 @@ 'use strict'

if (typeof val === 'string') {
return require(val)
try {
return require(val)
} catch (err) {}
}

@@ -36,2 +38,4 @@ return val

console.log(inject)
let sum = 0

@@ -38,0 +42,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc