guidelines - samuelchen/gagein-web-new GitHub Wiki

CommonJS is the base specific for the our design/implementation guidline.

  • Package

package.json

  • Logging

  • String

  • Module

Always export module functions at the end of file. DO NOT include the function body in module.exports = {...}.

var mymodule = {}
mymodule.func1 = function (arg) {
}
module.exports = mymodule;
  • Comment

  • Naming

  • Module should name as the same to filename

  • Variant should use unix naming rule