Agenda
- Node.js
- Modules
- NPM package manager
- Express
Node.js
- JavaScript Runtime
- Based on Google V8 JavaScript Engine
- One thread for JavaScript
- Asynchronous operations via LibUv
- Native Modules
- Module Ecosystem
## A Web Server
```js
var http = require('http');
http.createServer(function (req, res) {
res.writeHeader(200, {'Content-type': 'text/plain'});
res.write('Hello ');
res.end('World');
}).listen(8000);
```
Vibrant Community
NPM
- Node Package Manager
- Description in package.json
- Install packages in node_modules local folder
- Tree structure
- Local vs Global install
## package.json
```json
{
"name": "wine-cellar",
"description": "Wine Cellar Application",
"version": "0.0.1",
"private": true,
"dependencies": {
"express": "3.x",
"mongodb": "1.1.8",
"socket.io": "0.9.x"
},
"engines": {
"node": "0.8.4",
"npm": "1.1.49"
}
}
```
Express
- Web Framework
- Based on Connect
- MVC routing and views
- Minimalist
Node Cellar
The End
BY Angel 'Java' Lopez / www.ajlopez.com / @ajlopez