UNPKG

funstance

Version:

make an instance callable like a function

14 lines (10 loc) 222 B
var inherits = require('inherits'); var Stream = require('stream'); module.exports = Foo; inherits(Foo, Stream); function Foo (x) { this.x = x; } Foo.prototype.beep = function () { this.emit('beep', 'boop'); };