例如,使用构造函数调用时,如下所示:
var Symphonize = function(generation_specification){
this.gen_spec = generation_specification;
}
Symphonize.prototype.act_on_object = function () {
// Do actions here on the generation_specification value.
return this.gen_spec;
}
通过模块提供对此功能的访问的方法之一是什么?例如,如果我要将它添加到节点模块,那么想在我正在使用该模块的应用程序中调用它吗?我想基本上在调用应用程序代码中使用它。
var blu = require('./symphonize');
blu = new Symphonize({"gen":"stuff"});