View enum.js
function Enum(names) {
let members = Object.create(null);
members.tryParse = name => {
if (!members[name]) {
throw new Error(`Unable to parse '${name}' as an Enum member.`);
return members[name];

Keybase proof

I hereby claim:

  • I am jmar777 on github.
  • I am jmar777 ( on keybase.
  • I have a public key whose fingerprint is 5159 0463 0A5F 35F7 0ECC B9FB B5AB 0119 5DC6 FB5E

To claim this, I am signing this object:

View dw-node-http-request-example.js
function getTestPersonaLoginCredentials(cb) {
host: '',
path: '/email'
}, function(res) {
// explicitly treat incoming data as utf8 (avoids issues with multi-byte chars)
// incrementally capture the incoming response body
View debugging-node-elastic-beanstalk-woes
First, we need to figure out what the actual error is. This is obviously frustrating given that the error message is intentionally truncating it.
1) SSH in to your node (various guides available for this if you're not already familiar with this).
2) Run this command (basically an Elastic Beanstalk wrapper command for npm install I found in a blog post [1]):
$ sudo /opt/elasticbeanstalk/containerfiles/ --action npm-install 2
3) Find the actual error message in the output from the npm install.
Once you know the error, it should hopefully be fairly obvious how to fix it. I've run into two different errors over the last couple days on Elastic Beanstalk:
The first was a dependency that was using the new "^X.Y.Z" version syntax, which is only supported in Node >= v0.10.26 (whereas Elastic Beanstalk only supports up to v0.10.21 as of today). The solution here was easy: hardcode a dependency version *prior* to when that dependency adopted to the new syntax.
View index.js
var db = connect('localhost:27017/aggr-test');
print('Dropping indexes...');;
print('Creating index...');
var indexStart =;{ ts: 1 });
var indexDuration = (( - indexStart) / 1000).toFixed(2);
print('Index created (' + indexDuration + ' seconds)');
View gist:1571615
jmar777:gaas-license-verification jeremymartin$ jitsu deploy
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Authenticated as jmar777
info: Analyzing your application dependencies in app.js
warn: Local version appears to be old.
warn: Your package.json version will be incremented for you automatically.
warn: About to write /Users/jeremymartin/Projects/gaas-license-verification/package.json
View gist:1571603
jmar777:gaas-license-verification jeremymartin$ jitsu create
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command create
info: Authenticated as jmar777
warn: Your package.json file is missing required fields:
warn: scripts.start
View broken-makefile
.PHONY: clean install test test-tap test-api
rm ./test/results.tap
npm install
mocha -R list
View mocha-before-silent-error.js
describe('silent error', function() {
// ReferenceError bubbles up just fine
before(function() {
View app.js
var express = require('express'),
mongoose = require('mongoose'),
Model = require('./lib/model'),
Tap = Model.Tap;'/tap', function(req, res, next) {
var tap = new Tap(); =; =;
tap.update({ name: }, { upsert: true }, function(err) {