/* Date: Jan 19 2017 title: NodeJS enhanced CJS module pattern author: Shahzad Nawaz email: shahzadscs@gmail.com Description: This gist proposes an enhanced CommonJS module declaration pattern for nodeJS/express modules. */ //(all core imports,requires should be listed here. e.g "fs", etc) /*core modules*/ //... //(all external imports,requires should be listed here. e.g "express", etc) /*external modules*/ //... //(all module-scoped local vars, lets, should be listed here.) /*locals*/ //... //(any initialization(s) should be written here.) /*initialization*/ //... //(all routes, or anything similar should be listed together, along with ref to their handlers here) /*routes list*/ //... //(all module exports(first indirect ones (from another module), then direct ones) should be listed here.) /*exports*/ //... //(all handlers (routes, utils) should be listed here.) /*functions declarations*/ //...