UNPKG
funstance
Version:
latest (0.0.2)
0.0.2
0.0.1
0.0.0
make an instance callable like a function
github.com/substack/funstance
substack/funstance
funstance
/
example
/
foo
/
index.js
14 lines
(10 loc)
•
222 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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'
); };