0

When using constructor invocation, for instance, like this:

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;
}

What's one of the ways to provide access to this functionality via a module? If I were to add it to a node module for instance, then want to call it in an application I'm using the module in? I want to basically use it like this in the calling application code.

var blu = require('./symphonize');
blu = new Symphonize({"gen":"stuff"});
Adron
  • 1,558
  • 3
  • 18
  • 39
  • 1
    Fixed. Valid complaint the whole overloaded "best practice" notion. I'll leave best practices for Microsoft (that's supposed to be a snarky joke btw). ;) – Adron Jan 03 '14 at 17:12
  • I think you rather want `var Symphonize = require('./symphonize');` – Bergi Mar 02 '14 at 21:08
  • possible duplicate of [What is the purpose of NodeJS module.exports and how do you use it?](http://stackoverflow.com/questions/5311334/what-is-the-purpose-of-nodejs-module-exports-and-how-do-you-use-it) – Bergi Mar 02 '14 at 21:09

0 Answers0