My talk for the Hungarian webkonf, targeting newcomers to get a feeling of node.js and inspire them to learn it.
http://risingstack.com
Why Node.js?#webkonfGergely Nemeth@nthgergo
View Slide
WHOAMInodebp.comoneshot.risingstack.comrisingstack.com
JAVASCRIPT- created in 1995- runs in every major browser- prototype-based, dynamic typing, first-class functions
JAVASCRIPT
JAVASCRIPTnot just the language of the browser any more
FIRST-CLASS CITIZEN IN OSX
INTERNET OF THINGS
IN THE CLOUD
NODE.JS“for easily building fast, scalable networkapplications”
NODE.JS- V8
NODE.JS- V8- nonblocking I/O
NODE.JSBlocking I/Othe traditional wayNonblocking I/Othe Node.js way
NODE.JS- V8- nonblocking I/O- event driven
NODE.JS- V8- nonblocking I/O- event driven- single threaded
CALLBACKSfs.readFile('/file', function(err, data) {if (err) throw err;console.log(data);});
SOME OF THE ADOPTERS…
THE PAYPAL CASE-STUDYexisting Java stack
THE PAYPAL CASE-STUDYJava and Node in parallel
THE PAYPAL CASE-STUDYOne Language to Rule them all
THE PAYPAL CASE-STUDYNow all new apps at PayPal are written inNode.
THE PAYPAL CASE-STUDY- Headcount: from ⅓ to 1/10- Performance: 10x throughput in scale- Lines of code: code size shrink by factor of3-5
HOW?
NPM- open repository for Node modules- proper SemVer- more than 100.000 modules- open source all the things!
NPMWould be nice to use all this in the browser aswell?
BROWSERIFY- require('modules') in the browser- bundling up all of your dependencies fromthe node_modules dir- does not pollute the global scopehttp://blog.risingstack.com/publishing-your-first-browserify-node-module/
BROWSERIFY// main.jsvar $ = require('jquery');$('body').append('Hello Browserify!');npm install jquery --savebrowserify main.js -o bundle.js
Which brings us to...
ISOMORPHIC JAVASCRIPThttp://blog.risingstack.com/from-angularjs-to-react-the-isomorphic-way/
Thanks!Gergely Nemeth@nthgergo