Submit Search
Upload
Node.js primer
•
Download as PPTX, PDF
•
1 like
•
352 views
Quhan Arunasalam
Follow
Node.js primer for the pre-hackathon training @ SST (http://www.sst.edu.sg/hackathon/)
Read less
Read more
Technology
Report
Share
Report
Share
1 of 25
Download now
Recommended
Node.js Workshop
Node.js Workshop
Quhan Arunasalam
Solving anything in VCL
Solving anything in VCL
Fastly
VCL template abstraction model and automated deployments to Fastly
VCL template abstraction model and automated deployments to Fastly
Fastly
Beyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic Analysis
Fastly
6 things you need to know about GORM 6
6 things you need to know about GORM 6
Alvaro Sanchez-Mariscal
Improving the Accumulo User Experience
Improving the Accumulo User Experience
Accumulo Summit
Nginx + Tornado = 17k req/s
Nginx + Tornado = 17k req/s
moret1979
Managing Puppet using MCollective
Managing Puppet using MCollective
Puppet
Recommended
Node.js Workshop
Node.js Workshop
Quhan Arunasalam
Solving anything in VCL
Solving anything in VCL
Fastly
VCL template abstraction model and automated deployments to Fastly
VCL template abstraction model and automated deployments to Fastly
Fastly
Beyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic Analysis
Fastly
6 things you need to know about GORM 6
6 things you need to know about GORM 6
Alvaro Sanchez-Mariscal
Improving the Accumulo User Experience
Improving the Accumulo User Experience
Accumulo Summit
Nginx + Tornado = 17k req/s
Nginx + Tornado = 17k req/s
moret1979
Managing Puppet using MCollective
Managing Puppet using MCollective
Puppet
Introducing spring
Introducing spring
Ernesto Hernández Rodríguez
Design & Performance - Steve Souders at Fastly Altitude 2015
Design & Performance - Steve Souders at Fastly Altitude 2015
Fastly
Servlet or Reactive Stacks: The Choice is Yours. Oh No...The Choice is Mine!
Servlet or Reactive Stacks: The Choice is Yours. Oh No...The Choice is Mine!
VMware Tanzu
[1D1]신개념 N스크린 웹 앱 프레임워크 PARS
[1D1]신개념 N스크린 웹 앱 프레임워크 PARS
NAVER D2
Going crazy with Varnish and Symfony
Going crazy with Varnish and Symfony
David de Boer
How to send gzipped requests with boto3
How to send gzipped requests with boto3
Luciano Mammino
Tornado in Depth
Tornado in Depth
Òscar Vilaplana
DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)
Soshi Nemoto
Zenly - Reverse geocoding
Zenly - Reverse geocoding
CocoaHeads France
Vert.x – The problem of real-time data binding
Vert.x – The problem of real-time data binding
Alex Derkach
Advanced VCL: how to use restart
Advanced VCL: how to use restart
Fastly
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Luciano Mammino
The top 5 Kubernetes metrics to monitor
The top 5 Kubernetes metrics to monitor
Sysdig
Heroku 101 py con 2015 - David Gouldin
Heroku 101 py con 2015 - David Gouldin
Heroku
Preparation study of_docker - (MOSG)
Preparation study of_docker - (MOSG)
Soshi Nemoto
Présentation de HomeKit
Présentation de HomeKit
CocoaHeads France
Callbacks and control flow in Node js
Callbacks and control flow in Node js
Thomas Roch
Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...
Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...
Codemotion
手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務
Mu Chun Wang
Vert.x for Microservices Architecture
Vert.x for Microservices Architecture
Idan Fridman
Node.js primer for ITE students
Node.js primer for ITE students
Quhan Arunasalam
Sst hackathon express
Sst hackathon express
Aeshan Wijetunge
More Related Content
What's hot
Introducing spring
Introducing spring
Ernesto Hernández Rodríguez
Design & Performance - Steve Souders at Fastly Altitude 2015
Design & Performance - Steve Souders at Fastly Altitude 2015
Fastly
Servlet or Reactive Stacks: The Choice is Yours. Oh No...The Choice is Mine!
Servlet or Reactive Stacks: The Choice is Yours. Oh No...The Choice is Mine!
VMware Tanzu
[1D1]신개념 N스크린 웹 앱 프레임워크 PARS
[1D1]신개념 N스크린 웹 앱 프레임워크 PARS
NAVER D2
Going crazy with Varnish and Symfony
Going crazy with Varnish and Symfony
David de Boer
How to send gzipped requests with boto3
How to send gzipped requests with boto3
Luciano Mammino
Tornado in Depth
Tornado in Depth
Òscar Vilaplana
DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)
Soshi Nemoto
Zenly - Reverse geocoding
Zenly - Reverse geocoding
CocoaHeads France
Vert.x – The problem of real-time data binding
Vert.x – The problem of real-time data binding
Alex Derkach
Advanced VCL: how to use restart
Advanced VCL: how to use restart
Fastly
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Luciano Mammino
The top 5 Kubernetes metrics to monitor
The top 5 Kubernetes metrics to monitor
Sysdig
Heroku 101 py con 2015 - David Gouldin
Heroku 101 py con 2015 - David Gouldin
Heroku
Preparation study of_docker - (MOSG)
Preparation study of_docker - (MOSG)
Soshi Nemoto
Présentation de HomeKit
Présentation de HomeKit
CocoaHeads France
Callbacks and control flow in Node js
Callbacks and control flow in Node js
Thomas Roch
Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...
Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...
Codemotion
手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務
Mu Chun Wang
Vert.x for Microservices Architecture
Vert.x for Microservices Architecture
Idan Fridman
What's hot
(20)
Introducing spring
Introducing spring
Design & Performance - Steve Souders at Fastly Altitude 2015
Design & Performance - Steve Souders at Fastly Altitude 2015
Servlet or Reactive Stacks: The Choice is Yours. Oh No...The Choice is Mine!
Servlet or Reactive Stacks: The Choice is Yours. Oh No...The Choice is Mine!
[1D1]신개념 N스크린 웹 앱 프레임워크 PARS
[1D1]신개념 N스크린 웹 앱 프레임워크 PARS
Going crazy with Varnish and Symfony
Going crazy with Varnish and Symfony
How to send gzipped requests with boto3
How to send gzipped requests with boto3
Tornado in Depth
Tornado in Depth
DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)
Zenly - Reverse geocoding
Zenly - Reverse geocoding
Vert.x – The problem of real-time data binding
Vert.x – The problem of real-time data binding
Advanced VCL: how to use restart
Advanced VCL: how to use restart
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
Universal JS Web Applications with React - Luciano Mammino - Codemotion Rome ...
The top 5 Kubernetes metrics to monitor
The top 5 Kubernetes metrics to monitor
Heroku 101 py con 2015 - David Gouldin
Heroku 101 py con 2015 - David Gouldin
Preparation study of_docker - (MOSG)
Preparation study of_docker - (MOSG)
Présentation de HomeKit
Présentation de HomeKit
Callbacks and control flow in Node js
Callbacks and control flow in Node js
Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...
Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...
手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務
Vert.x for Microservices Architecture
Vert.x for Microservices Architecture
Similar to Node.js primer
Node.js primer for ITE students
Node.js primer for ITE students
Quhan Arunasalam
Sst hackathon express
Sst hackathon express
Aeshan Wijetunge
Psgi Plack Sfpm
Psgi Plack Sfpm
som_nangia
Psgi Plack Sfpm
Psgi Plack Sfpm
wilburlo
Plack - LPW 2009
Plack - LPW 2009
Tatsuhiko Miyagawa
Open Source, infrastructure as Code, Cloud Native Apps 2015
Open Source, infrastructure as Code, Cloud Native Apps 2015
Jonas Rosland
Automatisation in development and testing - within budget
Automatisation in development and testing - within budget
David Lukac
EWD 3 Training Course Part 37: Building a React.js application with ewd-xpres...
EWD 3 Training Course Part 37: Building a React.js application with ewd-xpres...
Rob Tweed
02 servlet-basics
02 servlet-basics
snopteck
Ite express labs
Ite express labs
Aeshan Wijetunge
Introduction to Node.js
Introduction to Node.js
Vikash Singh
The Play Framework at LinkedIn
The Play Framework at LinkedIn
Yevgeniy Brikman
The Play Framework at LinkedIn: productivity and performance at scale - Jim B...
The Play Framework at LinkedIn: productivity and performance at scale - Jim B...
jaxconf
Original slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talk
Aarti Parikh
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
mfrancis
Develop microservices in php
Develop microservices in php
Zend by Rogue Wave Software
01 overview-and-setup
01 overview-and-setup
snopteck
Play Support in Cloud Foundry
Play Support in Cloud Foundry
rajdeep
Introduction to node.js
Introduction to node.js
Su Zin Kyaw
Kraken.js Lab Primer
Kraken.js Lab Primer
Aeshan Wijetunge
Similar to Node.js primer
(20)
Node.js primer for ITE students
Node.js primer for ITE students
Sst hackathon express
Sst hackathon express
Psgi Plack Sfpm
Psgi Plack Sfpm
Psgi Plack Sfpm
Psgi Plack Sfpm
Plack - LPW 2009
Plack - LPW 2009
Open Source, infrastructure as Code, Cloud Native Apps 2015
Open Source, infrastructure as Code, Cloud Native Apps 2015
Automatisation in development and testing - within budget
Automatisation in development and testing - within budget
EWD 3 Training Course Part 37: Building a React.js application with ewd-xpres...
EWD 3 Training Course Part 37: Building a React.js application with ewd-xpres...
02 servlet-basics
02 servlet-basics
Ite express labs
Ite express labs
Introduction to Node.js
Introduction to Node.js
The Play Framework at LinkedIn
The Play Framework at LinkedIn
The Play Framework at LinkedIn: productivity and performance at scale - Jim B...
The Play Framework at LinkedIn: productivity and performance at scale - Jim B...
Original slides from Ryan Dahl's NodeJs intro talk
Original slides from Ryan Dahl's NodeJs intro talk
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
OSGi Enterprise R6 specs are out! - David Bosschaert & Carsten Ziegeler
Develop microservices in php
Develop microservices in php
01 overview-and-setup
01 overview-and-setup
Play Support in Cloud Foundry
Play Support in Cloud Foundry
Introduction to node.js
Introduction to node.js
Kraken.js Lab Primer
Kraken.js Lab Primer
Recently uploaded
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Malak Abu Hammad
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Hyundai Motor Group
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
Deakin University
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Puma Security, LLC
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Delhi Call girls
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
Allon Mureinik
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
AndikSusilo4
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
BookNet Canada
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
null - The Open Security Community
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Sinan KOZAK
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
carlostorres15106
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
Delhi Call girls
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
comworks
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Delhi Call girls
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Patryk Bandurski
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
XfilesPro
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
soniya singh
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
null - The Open Security Community
Recently uploaded
(20)
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Node.js primer
1.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary. Node.js Quhan Arunasalam June / 03 / 2015 Hackathon@SST
2.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary What we’re going to explore today 2 Node.js NPM An open source, cross-platform runtime environment for server-side Javascript applications. A package manager for Javascript.
3.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary Node.js Run Javascript on the server 3
4.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary Understanding the Event Loop The guts of Node 4
5.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary Do JSON based REST APIs Web / Mobile-Web Apps Network Apps Don’t CPU intensive work When to use Node? 5
6.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary Test the waters via REPL The Read-Eval-Print Loop 6 • Provides a way to interactively run JavaScript and see the results. • Useful for debugging, testing, or just trying things out. https://www.flickr.com/photos/snype451/5752753663/
7.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary Lab 2.1: Test the waters via REPL Read-Eval-Print-Loop 7 $ node > var a = [1, 2, 3]; > console.log(a); [ 1, 2, 3 ] > a.forEach(function (z) { console.log(z); }); 1 2 3
8.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary Lab 2.2: Baby-steps Building the classic Hello World 8 $ mkdir hello && cd hello $ touch index.js // index.js console.log('Hello SST'); $ node index Hello SST https://www.flickr.com/photos/munakz/9228501911/
9.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary The module system The building blocks of a Node app 9 http://pixabay.com/en/lego-building-blocks-shapes-puzzle-297773/ • Makes it possible to include other Javascript files into your app. • Helps organize your code into separate parts with limited responsibilities. • Using modules is simple - You just require() them.
10.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary Lab 2.3: Requiring things Modifying your previous Hello World example 10 $ touch greet.js // greet.js exports.hello = function () { return 'Hello SST'; } // index.js var greet = require('./greet.js'); console.log(greet.hello()); $ node index Hello SST
11.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary Lab 2.4: Requiring things (again) Let’s get bilingual 11 // greet.js exports.hello = function () { return 'Hello SST'; } exports.konbanwa = function () { return 'Konbanwa SST'; } // index.js var greet = require('./greet.js'); console.log(greet.hello()); console.log(greet.konbanwa()); $ node index Hello SST Konbanwa SST
12.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary Lab 2.5: Requiring things (one last time) Another way of handling exports 12 // greet.js module.exports = { hello: function () { return 'Hello SST'; }, konbanwa: function () { return 'Konbanwa SST'; } };
13.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary In-built modules Don’t worry, we’re getting to the fun parts 13 http://commons.wikimedia.org/wiki/File:AMC_V8_engine_360_CID_customized_um.JPG Node ships with a number of core modules. For example: • console - Sends output to stdout or stderr. • http - Provides a server and client for HTTP traffic. • fs - Provides functions to interact with the file system.
14.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary Lab 2.6: Create a better (Hello) World By building a web server 14 // index.js var http = require('http'); var greet = require('./greet.js'); http.createServer(function (req, res) { res.writeHead(200); res.end(greet.hello()); }).listen(80); console.log('Server running at port 80');
15.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary Lab 2.6: Create a better (Hello) World Ta-daa! 15
16.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary Reuse and share code NPM 16
17.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary What is npm? It’s 3 things actually 17 https://www.flickr.com/photos/kamshots/3096111340/ • A module registry, containing a collection of open-source code. • A standard, to define dependencies on other packages. • A package manager, for locally installed modules.
18.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary The npmjs.com registry Note the 134,726 packages available (at the time of screenshot) 18
19.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary Lab 2.7: Initializing your Hello World project With metadata 19 $ npm init ... name: (hello) version: (1.0.0) description: An app to say Hello SST entry point: (index.js) test command: git repository: keywords: helloworld author: Quhan Arunasalam license: (ISC)
20.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary Lab 2.8: Saving the moment Installing and using a 3rd party module 20 $ npm install --save moment // index.js var http = require('http'); var greet = require('./greet.js'); var moment = require('moment'); http.createServer(function (req, res) { res.writeHead(200); res.end('Hi! It is now ' + moment().format('h:mm:ss a')); }).listen(80); console.log('Server running at port 80');
21.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary Lab 2.8: Saving the moment Ta-daa! 21
22.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary 22 Figuring out package.json { "name": "hello", "version": "1.0.0", "description": "An app to say Hello SST", "main": "index.js", "scripts": { "test": "echo "Error: no test specified" && exit 1" }, "keywords": [ "helloworld" ], "author": "Quhan Arunasalam", "license": "ISC", "dependencies": { "moment": "^2.9.0" } }
23.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary Let’s not publish another hello world 8814 packages available (at the time of screenshot) 23
24.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary Let’s not publish another hello world Hiding away your little secrets 24 { "name": "hello", "version": "1.0.0", "private": true, "description": "An app to say Hello SST", ... }
25.
© 2015 PayPal
Inc. All rights reserved. Confidential and proprietary. For more information, please contact: PayPal Singapore 5 Temasek Boulevard #09-01, Suntec Tower Five, Singapore 038985 Quhan Arunasalam
Download now