Intro to Node.js Derek Watson
Mar 29, 2014
Story time!
JavaScript
Pretty cool language #javascript
The Working Group
Software shop @twg
Derek Watson
Developer guy @dcwca
and me
what is it good for?
What is it good for?
• JSON APIs
#twg@twg
What is it good for?
• JSON APIs
• Network servers
#twg@twg
What is it good for?
• JSON APIs
• Network servers
• Realtime applications
#twg@twg
!
MODULES
everything is a module
Modules everywhere
• Your app code is written as modules
• Libraries you use are modules
• Your whole app is one big module
#twg@twg
doge.js: An example module
#twg@twg
doge.js
program.js
Try it out!
“The main thing that distinguishes legacy code is a lack of tests.”
- Michael Feathers
test/doge.js
test/doge.js
test/doge.js
server.js
server.js
Try it out!
server.js
package.json
Module Learnings
• Write some code
• Export: module.exports = { say: say }
• Import: var doge = require(‘../doge’)
• Write some tests
• Compose modules into apps
• The outside world: package.json
#twg@twg
NODE.JS API
QUALITY: • Very well documented • Almost completely stable • Moving towards 1.0
!QUANTITY:
• As small as possible • You can learn it in a day or two
Core API
#twg@twg
NODE PACKAGE MANAGER
65,000 packages
But which packages are good?
• Learn to sniff out the quality
• Read npm’s Most Starred, Most Required
• Build your own bag of tricks
#twg@twg
express, restify jade, stylus
mongoose, sequelize async, q
ws, primus mocha, chai
yargs bunyan forever
“It’s not what you know, it’s who you know”
- Abraham Lincoln
substack
caolanbriancv1feross
tjholowaychuk isaacs henrikjoreteg
Node.js is General-Purpose
• Conventional web apps
#twg@twg
Node.js is General-Purpose
• Conventional web apps
• Realtime web apps
#twg@twg
Node.js is General-Purpose
• Conventional web apps
• Realtime web apps
• Cross-platform desktop apps
#twg@twg
Node.js is General-Purpose
• Conventional web apps
• Realtime web apps
• Cross-platform desktop apps
• Network servers
#twg@twg
CONTROL ROBOTS
#twg@twg
Inclusive, friendly people who are open to learning and teaching
!Toronto Node.JS Meetup
Currently hosted at the TWG studio !
Amazing conferences Such as this one! And many others
Vibrant Community
#twg@twg
#twg@twg
NodeUp Podcast - Team Episodes
#twg@twg
Node.js Low barrier to entry
Simple
Powerful
BE EXCITEDbe, be excited
Thank You.
Top Related