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

b

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

b - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

27

lib/reporters/cli.js

@@ -23,10 +23,11 @@

var out = this.out;
var title = name + ' x ' + iterations;
[
' '+yellow(name),
'------------------',
'Iterations: ' + magenta(iterations),
'Result: ' + cyan(result / 1e6 + ' ms'),
'',
yellow(name) + ' x ' + iterations,
repeat('-', title.length).join(''),
'Total: ' + cyan(result / 1e6 + ' ms'),
// 'Average: ' + cyan(result / iterations + ' ns')
].forEach(function(line) {
out.write(line + '\n');
out.write(' ' + line + '\n');
});

@@ -36,2 +37,16 @@ };

/**
* Repeat
*
* @param {Any} l
* @param {Number} i
* @returns {Array}
*/
function repeat(l, i){
var res = [];
while (i--) res.push(l);
return res;
};
/**
* Yellow

@@ -38,0 +53,0 @@ *

{
"name": "b"
, "version": "2.0.0"
, "version": "2.0.1"
, "description": "Benchmarks for Node.js."

@@ -5,0 +5,0 @@ , "keywords": ["benchmarks", "benchmarking"]

@@ -1,7 +0,1 @@

/*!
* B - Benchmarks for Node.js.
*
* Veselin Todorov <hi@vesln.com>
* MIT License.
*/

@@ -11,2 +5,3 @@ /**

*/
var should = require('chai').should();

@@ -16,5 +11,4 @@

* Benchmark
*
* @type {Function}
*/
var Benchmark = require('../lib/benchmark');

@@ -24,5 +18,4 @@

* Reporter
*
* @type {Function}
*/
var Reporter = require('../lib/reporters/cli');

@@ -32,5 +25,4 @@

* Subject
*
* @type {Function}
*/
var b = require('..');

@@ -37,0 +29,0 @@

@@ -1,7 +0,1 @@

/*!
* B - Benchmarks for Node.js.
*
* Veselin Todorov <hi@vesln.com>
* MIT License.
*/

@@ -11,2 +5,3 @@ /**

*/
var should = require('chai').should();

@@ -16,5 +11,4 @@

* Test Reporter
*
* @type {Function}
*/
var TestReporter = require('./support/test_reporter');

@@ -24,5 +18,4 @@

* Subject
*
* @type {Function}
*/
var Benchmark = require('..');

@@ -29,0 +22,0 @@

@@ -1,7 +0,1 @@

/*!
* B - Benchmarks for Node.js.
*
* Veselin Todorov <hi@vesln.com>
* MIT License.
*/

@@ -11,16 +5,15 @@ /**

*/
var should = require('chai').should();
/**
* Fake Stream
*
* @type {Function}
* Fake Stream.
*/
var FakeStream = require('./support/fake_stream');
/**
* Subject
*
* @type {Function}
* Subject.
*/
var Reporter = require('../lib/reporters/cli');

@@ -56,6 +49,7 @@

reporter.report('Test benchmark', 1000000, 100);
stream.out[0].should.eq('Test benchmark');
stream.out[2].should.eq('Iterations: 100');
stream.out[3].should.eq('Result: 1 ms');
var buf = stream.out.join('');
buf.should.include('Test benchmark');
buf.should.include('x 100');
buf.should.match(/Total: +1 ms/);
});
});

@@ -1,7 +0,1 @@

/*!
* B - Benchmarks for Node.js.
*
* Veselin Todorov <hi@vesln.com>
* MIT License.
*/

@@ -11,4 +5,5 @@ /**

*
* @api public
* @constructor
*/
function FakeStream() {

@@ -24,2 +19,3 @@ this.out = [];

*/
FakeStream.prototype.write = function(input) {

@@ -39,2 +35,3 @@ this.out.push(normalize(input));

*/
function normalize(string) {

@@ -50,2 +47,3 @@ return string.replace(/\x1B\[[0-9;]*[mK]/g, '')

*/
module.exports = FakeStream;

@@ -1,7 +0,1 @@

/*!
* B - Benchmarks for Node.js.
*
* Veselin Todorov <hi@vesln.com>
* MIT License.
*/

@@ -13,2 +7,3 @@ /**

*/
function TestReporter() {};

@@ -24,2 +19,3 @@

*/
TestReporter.prototype.report = function(name, result, iterations) {

@@ -34,2 +30,3 @@ this.name = name;

*/
module.exports = TestReporter;
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