coffee CLI
real 0m0.124s
user 0m0.102s
sys 0m0.022s
var time = 1e3; | |
function benchBinding() { | |
console.time('bench-binding'); | |
for (var i = 0; i < time; i++) { | |
var Process = process.binding('process_wrap').Process; | |
var WriteWrap = process.binding('stream_wrap').WriteWrap; | |
var uv = process.binding('uv'); |
var validator = require('artisan-validator')(); | |
validator.try(... function(errors) { | |
var msg = Object.keys(result.errors).map(function(name) { | |
return result.errors[name].join(' '); | |
})[0]; | |
}); |
// Middleware for attaching the Handlefiles engine to ExpressJS | |
// Kind of hacky, since we attach it directly to express/lib/response | |
var path = require('path'); | |
var handlefiles = require('handlefiles'); | |
var Response = require('express/lib/response'); | |
var viewDirectory = path.join(__dirname, '..', 'views'); | |
/** | |
* Configures Express to use the correct view engine. |
$ vagrant ssh |
$ vagrant init hashicorp/precise32 | |
$ vagrant up |
total = 0 | |
for num in [1..5000] | |
total += num | |
console.log total |
{ | |
"name": "bench", | |
"version": "0.0.2", | |
"repo": "brendanashworth/bench", | |
"description": "Easy to use, beautiful-looking benchmarking library", | |
"keywords": ["benchmark", "bench", "speed"], | |
"license": "MIT", | |
"src": ["bench.h", "bench.c"] | |
} |
function Person(age) { | |
if (age > 18) this.age = age; | |
} | |
Person.prototype.age = 18; |
Client.prototype.zipcode = 12345; | |
// Utilizes a closure | |
Client.prototype.defaultAge = (function() { | |
return prompt("What should the default age be?"); | |
})(); |