I know there are many opinions on the best way to organize functions into
Node modules.
I'd like to throw out an example and see what people think.
Suppose you are writing a module that performs basic statistics.
There are three functions that compute the mean, median and mode of values
in an array.
Here are some ways I think people might organize these.
1) Create a separate module for each function.
2) Create one module that only exports the mean function, viewing it as the
most commonly used of the three.
Add the median and mode functions as properties of the mean function so
they can be accessed from it.
3) Create one module that exports all three functions.
Which of these would you prefer? Is there another option I haven't
described?
--
R. Mark Volkmann
Object Computing, Inc.
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en