The coolest cortex module
Before anything taking its part, you should install node and "cortex".
Visit http://nodejs.org, download and install the proper version of nodejs.
# maybe you should use `sudo`
npm install -g cortex
First, install 'mage' directly with cortex install
(recommended)
cortex install mage --save
or, you could update your package.json manually
dependencies: {
'mage': '<version-you-want>'
}
and install dependencies
cortex install
Then, use require
method in your module
var mage = require('mage');
Finally, start cortex server
cortex server
Then cortex will care all the rest.
': constructor' means the module.exports
of module 'mage' is a constructor that we should use it with the new
keyword
new mage(options)
- options.name {String}
Means this is a static method of module.exports
// arguments description here
Mean this is a method of the instance
// arguments description here