2. NOT ANOTHER NODE.JS
HELLO WORLD
• An application built to run on node.js
• Concepts
• Modules used for the application
• Modules extracted from the application
• How dependencies of modules was managed
• Design decisions made during development
• Hosting
3. NOT ANOTHER NODE.JS
HELLO WORLD
• An application built to run on node.js
• Concepts
• Modules used for the application
• Modules extracted from the application
• How dependencies of modules was managed
• Design decisions made during development
• Hosting
5. NOT ANOTHER NODE.JS
HELLO WORLD
• An application built to run on node.js
• Concepts
• Modules used for the application
• Modules extracted from the application
• How dependencies of modules was managed
• Design decisions made during development
• Hosting
11. MONGOOSE
var mongoose = require('../modules/mongoose/mongoose').Mongoose;
var db = mongoose.connect('mongodb://localhost/tapas');
mongoose.model('User', {
'properties': ['username', 'password', 'first', 'last', ...],
'indexes': ['first', 'last', [{'username':1},{unique: true}]],
'methods': {
save: function(fn){
this.updated_at = new Date();
this.__super__(fn);
}
}
});
module.exports = db.model('User');
12. LOG4JS
var log4js = require('log4js');
log4js.addAppender(log4js.fileAppender('log/app.log'), 'controller.client');
var logger = log4js.getLogger('controller.client');
logger.setLevel('DEBUG');
logger.debug(‘hello, world’);
[2010-09-28 19:50:24.816] [DEBUG] controller.user - hello, world
13. NOT ANOTHER NODE.JS
HELLO WORLD
• An application built to run on node.js
• Concepts
• Modules used for the application
• Modules extracted from the application
• How dependencies of modules was managed
• Design decisions made during development
• Hosting
14. EXTRACTED MODULES
• node-daemon - a module for start-stop functionality without
the need for init.d scripts (http://github.com/theteam/node-
daemon)
• node-properties - a module for reading JSON property files
using override pattern borrowed from Ant (http://github.com/
theteam/node-properties)
• tapas-models
- a module for common data entities with
mongodb wrappers - (http://github.com/theteam/tapas-
models)
15. NOT ANOTHER NODE.JS
HELLO WORLD
• An application built to run on node.js
• Concepts
• Modules used for the application
• Modules extracted from the application
• How dependencies of modules was managed
• Design decisions made during development
• Hosting
16. NDISTRO
• Bash script that creates distributions from github for node
binaries and modules
• Because it’s bash, it can easily be extended
• Hash simple syntax
• If
modules are configured nicely, will symlink modules onto
node execution path
18. NOT ANOTHER NODE.JS
HELLO WORLD
• An application built to run on node.js
• Concepts
• Modules used for the application
• Modules extracted from the application
• How dependencies of modules was managed
• Design decisions made during development
• Hosting
20. NOT ANOTHER NODE.JS
HELLO WORLD
• An application built to run on node.js
• Concepts
• Modules used for the application
• Modules extracted from the application
• How dependencies of modules was managed
• Design decisions made during development
• Hosting