Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introduction to NodeJs
Search
Anthony Pipkin
July 24, 2014
Technology
0
74
Introduction to NodeJs
High level overview of what NodeJs is and how it can do cool things.
Anthony Pipkin
July 24, 2014
Tweet
Share
More Decks by Anthony Pipkin
See All by Anthony Pipkin
Introduction to ReactJs
apipkin
2
110
Introduction to AngularJs
apipkin
1
160
Building for the new Gallery
apipkin
1
200
Other Decks in Technology
See All in Technology
スプリントレトロスペクティブはチーム観察の宝庫? 〜チームの衝突レベルに合わせたアプローチ仮説!〜
electricsatie
1
160
ガチな登山用デバイスからこんにちは
halka
1
210
Grafana MCPサーバーによるAIエージェント経由でのGrafanaダッシュボード動的生成
hamadakoji
1
1.3k
フィンテック養成勉強会#56
finengine
0
120
Obsidian応用活用術
onikun94
1
390
Codeful Serverless / 一人運用でもやり抜く力
_kensh
4
160
複数サービスを支えるマルチテナント型Batch MLプラットフォーム
lycorptech_jp
PRO
0
180
[RSJ25] Feasible RAG: Hierarchical Multimodal Retrieval with Feasibility-Aware Embodied Memory for Mobile Manipulation
keio_smilab
PRO
0
100
「何となくテストする」を卒業するためにプロダクトが動く仕組みを理解しよう
kawabeaver
0
170
サンドボックス技術でAI利活用を促進する
koh_naga
0
190
Snowflakeの生成AI機能を活用したデータ分析アプリの作成 〜Cortex AnalystとCortex Searchの活用とStreamlitアプリでの利用〜
nayuts
0
290
5年目から始める Vue3 サイト改善 #frontendo
tacck
PRO
3
190
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.5k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.6k
Fireside Chat
paigeccino
39
3.6k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
We Have a Design System, Now What?
morganepeng
53
7.8k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Designing for humans not robots
tammielis
253
25k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
YesSQL, Process and Tooling at Scale
rocio
173
14k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
186
54k
Transcript
Hello, my name is node.js but you may call me
"node"
Before We Start
We need: Knowledge of JavaScript Web Browser Terminal
What about help? nodejs.org docs #node.js on Freenode IRC StackOverflow
General searching for javascript, node.js, or npm
What is Node?
According to Node Node's goal is to provide an easy
way to build scalable network programs
According to me NodeJs is a super awesome tool that
allows me to take over the world.
But seriously... JavaScript ECMAScript 5 No ugly DOM! Built on
top of V8 Single threaded Asynchronous, non-blocking I/O Windows, Mac, Linux
Let's get started!
Step 1 Go to http://nodejs.org Click the `install` button. Follow
the instructions.
Step 2 Gain an understanding of: Prototypal Inheritance Closures Event
Loop
Step 2a JavaScript the Good Parts - Douglas Crockford http://livestre.am/JC3U
or http://amzn.com/B002AWX8BO Eloquent JavaScript - Marijn Haverbeke http://eloquentjavascript.net/ JavaScript Design Patterns - Addy Osmani http://addyosmani.com/resources/essentialjsdesignpatterns/book
Step 3
Step 4 Profit Global Domination You get the point
Doing Good with NodeJs Event Driven Promises Callbacks
Event Driven require('events') Extend with EventEmitter Simple API on once
removeListener removeAllListeners emit
Promises Relatively new to JavaScript promisejs.org npm packages q promised-io
deferred promise.then(successFn, errorFn, progressFn)
Callbacks `(err, data)` pattern `.bind` to maintain scope ( )
maintains variables where defined http://www.digital-web.com/articles/scope_in_javascript/ More on JavaScript patterns in the online book(s).
Package Management npm 85,000+ packages Packages can be global or
isolated to project
Building Packages npm init package.json configuration for node module dependency
information command line load point (`bin`) npm install module npm install module --save Saved in ./node_modules/
Usage require('mod') core or npm require('./mod') relative to app require('/home/mod')
absolute from drive
Command Line which node HashBang (#!) path +x the js
file to it's executable make it installable via npm
Demo!
Web Server & Apps http clusters, PM2 ExpressJs, HapiJs, Restify
Socket.io ( ) nodemon database MongoDb MySQL Postgres http://caniuse.com/websockets
Demo!
Don't Use Node for... Number Crunching (IEEE 754 "Double") 0.1
+ 0.2 === 0.3 // false Synchronous I/O calls Shell Scripting * Making toast ? ( ) http://youtu.be/MqHDDtVYJRI http://survivejs.com/current_state/might_run_on_toaster.html
Thanks! Me: Anthony Pipkin @apipkin http://a.pipk.in http://github.com/apipkin http://linkedin.com/in/apipkin Questions?
Interesting Links http://www.toptal.com/javascript/guide-to-full-stack- javascript-initjs http://www.toptal.com/nodejs/why-the-hell-would-i-use- node-js http://wintellect.com/blogs/dbanister/stop-fighting-node.js- in-the-enterprise