Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

node.js

No description
by

Boris Filipov

on 3 November 2012

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of node.js

hackerspace @Varna Boris Filipov "Distributed developer" 31/05/2009 Ryan Dahl releases the first tarball -> node
30/09/2009 NPM
02/02/2010 howtonode.org
08/07/2011 node.js 3rd in github
11/08/2012 node with 13,142 packages node.js :: History C++ executable with V8 javascript virtual machine Какво е node? Къде се използва node.js? server-side apps
command line apps
desktop apps (!) :) $ node myscript.js node.js application - module with modules script.js module.js var module = require("./module");
module.start();

var Class = require("./Class");
var instance = new Class(); module.exports.start = function(){
console.log("module started");
} Class.js var Class = function(){
console.log("instance created");
}

module.exports = Class; <root folder>
| - script.js
| - module.js
| - Class.js node_modules <root folder>
| - main.js
| + node_modules
| - myModule.js
| + express
| - index.js
| + node_modules
| + cookieParser
| + lib
| - index.js
| - package.json main.js require("express") require("cookieParser") express / index.js require("myModule") http://nodejs.org/api/modules.html#modules_all_together http://npmjs.org/ Node Package Manager + Package
| - package.json | + lib
| - index.js
| + bin
| - command.js "name" : "MyPackage",
"version" : "0.0.1",
"main" : "./lib/index.js",
"bin" : {
"command": "./bin/command.js"
},
"dependencies" : {
"express": "latest",
"socket.io": "0.4.1"
} Camplight open company npm install
npm install packageName
npm install http://url
npm install packageName -g npm init "npm loves you" npm shrinkwrap "dependencies" : {
"express": "latest",
"socket.io": "latest"
} npm commands package.json node_modules http://nodejs.org/ node.js install Unix/ Node Version Manager git clone git://github.com/creationix/nvm.git ~/.nvm
. ~/.nvm/nvm.sh
nvm install v0.8.1
nvm use v0.8.1 EventEmitter Node Core Modules process fs http & https Stream Buffer net child_process cluster console Package Node Modules web frameworks database build & deployment control flow Connect Meteor Derby RailwayJS Tower.js async 11.08.2012 13,142 packages substack node-browserify dnode socket.io indexzero LearnBoost visionmedia engine.io Node Modules Contributors node-organic Cell Nucleus with dna.json plasma membrane with a hole Organel node.js process var Cell = require("organic").Cell;
var myCell = new Cell("./dna.json"); httpServer (+/- socket.io)
socketServer emits incoming requests as Chemicals
responds to outgoing Chemicals as response dna.json {
"membrane" : [
"path" : "./httpServer",
"port" : 8080
],
"plasma" : [
"./plasma/pageRouter",
"./plasma/pageRender"
]
} Chemical { "type": String, ... } Chemical {
type: "incomingHttpRequest",
req: RequestObject,
} this.emit( Chemical );

this.on(pattern, function(chemical) {
}); "on" patterns: ObjectTypes ( Error, MyChemical & etc... )
Strings ( matches chemical.type ) EventBus var util = require("util");
var Organel = require("organic").Organel;
var Chemical = require("organic").Chemical;

module.exports = function LogHandler(plasma){
Organel.call(this, plasma);

this.on("log", function(chemical){
console.log("LOG:".blue+chemical.data);
});
}

util.inherits(module.exports, Organel); SiteContent Cells AdminSiteContent Cells Site Organ Blood Благодаря за вниманието :) http://github.com/varnalab/node-organic
develop branch Creature api-easy jade
expressjs & many many more Controller @obiwon
Full transcript