#Readme
##Lessons
This project is for
Warmup 1 - Create An NPM Package
Warmup 2 - Setting Up Mocha For Testing
Warmup 3 - Using CoffeeScript
##Notes
###Warmup 1
-
nvm is for controling multiple version of node. If one don't need to, check note 2 while no find path "~/.nvm/"
-
Default path on OS X is /usr... if install by binary. So write
export NODE_PATH=/usr/local/lib/node_modules
into ~/.bashrc -
There are two paths for npm. Gernal package install to $NODE_PATH may be better. Check npm 1.0: Global vs Local installation
-
The process object has lot of infomation. Could be very useful.
-
Node command line runtime may need to quit to refresh modules?
-
require is to get an entrance function of a package. A package is a module that has single objection. An executable in ./bin is separate from the module it self. But usually they have same purpose.
-
npm install XXX --save-dev
is for dev using packages, like test.
npm install XXX --save
is for both dev and release.
Alsonpm link
can make local package global.
###Warmup 2
-
BDD:Behavior Driven Development. Using nature language to describe test case, and push development.
-
In browsers using
var something
will define a global variable. In Node usingglobal.XXX
to define a true top-level & cross-module global variable.var something
inside a Node module will be local to that module. -
Test Sample
describe('case/module name', function(){
it("case 1 content", function(){
expect(do sth).xx.xxx(output);
});
it("case 2 content", function(){
expect(do sth).xx.xxx(output);
});
....
});
###Warmup 3