exports.js 574 B

12345678910111213141516171819202122232425
  1. /**
  2. * An example of a server-side JavaScript module.
  3. * @module hello/world
  4. * @example
  5. * var g = require('hello/world').sayHello('Gracie');
  6. */
  7. /**
  8. * Generate a greeting.
  9. * @param {string} [subject="world"] To whom we say hello.
  10. * @returns {string}
  11. */
  12. exports.sayHello = function(subject) {
  13. return 'Hello ' + (subject || 'World');
  14. };
  15. /**
  16. * Generate a morose farewell.
  17. * @param {string} [subject="world"] To whom we say goodbye.
  18. * @returns {string}
  19. */
  20. module.exports.sayGoodbye = function(subject) {
  21. return 'Goodbye Cruel ' + (subject || 'World');
  22. };