UNPKG

protein

Version:

Protein is http prototype mixins for Node.js

12 lines (8 loc) 268 B
var assert = require('assert'); var protein = require('../index'); var hello = function() {}; var mixin = protein().use('request.hello', hello); var request = {}; mixin(request, {}); assert.equal(request.hello, hello); assert.equal(request.__proto__.hello, hello);