Hi team I know that there is tutorial and stuff...but I need some one to please tell explain me what is commonjs and what is for and what it does??
1 Answer
The basic idea is to have logical modules, some Kind of classes but more than that. Each commonJS Module will have its own context so you are able to use same var names in different modules without collision. This reduces the complexity in the app itself and if you Code clever you can reuse them in other apps. You can require them as often as you want. Ti will Cache it and Take care of including them once. CommonJS also enavles JS to have some Kind of public/private functions/vars/properties through the exports property.
Your Answer
Think you can help? Login to answer this question!