+ code based on https://github.com/substack/node-grave