Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

JavaScript… …has won the Web. Scott Hanselman

Slide 3

Slide 3 text

Any application that can be written in JavaScript… …will eventually be written in JavaScript (search for “jslinux”) Atwood’s Law:

Slide 4

Slide 4 text

JavaScript… …is tragically important. Douglas Crockford

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

Up Ahead • Why Node.js? • Crash course • Tools and frameworks • Integration strategies

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

ES 2016 (ES6) Support https://kangax.github.io/compat-table/es6/

Slide 20

Slide 20 text

What’s my story? • ASP.NET MVC, C# • SQL Server + NHibernate • JavaScript + JQuery

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

What’s my story? • JavaScript • Recruiting • Productive, less friction – Testing – Microservices – RabbitMQ, redis – Cross-platform

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

Why Node.js? • Rapid innovation & delivery • Developer happiness • Attract & retain talent • Performance “Why Node.js is Becoming the Go-To Technology in the Enterprise” – nearform.com

Slide 26

Slide 26 text

Why Node.js? productivity satisfaction performance lower costs Improved results year-over-year 2017 Node.js Foundation User Survey, Executive Summary

Slide 27

Slide 27 text

Node.js exemplifies… • Start with the simplest solution that works • Do one thing, and do it well

Slide 28

Slide 28 text

• Backend API for SPAs, Mobile apps, etc. • “Serverless” computing • Real-time, streaming • WebSockets, push notifications • Chat, IM, social media • DevOps • Microservices Node.js Use Cases

Slide 29

Slide 29 text

Node.js Use Cases • Backend API for SPAs, Mobile apps, etc. • “Serverless” computing • Real-time, streaming • WebSockets, push notifications • Chat, IM, social media • DevOps • Microservices

Slide 30

Slide 30 text

More than just backend • Create Automation Scripts • Internet of Things • Create CLI tools using nexe • Create Desktop Apps

Slide 31

Slide 31 text

Atom Slack Visual Studio Code

Slide 32

Slide 32 text

Fandango • dramatically shorter development cycles • micro-services architecture • flexibility in deployment • easily scalable infrastructure “Fandango Goes Live with Node.js” – nearform.com

Slide 33

Slide 33 text

• 2x faster development with fewer developers • 33% fewer lines of code • 40% fewer files • 2x improvement requests/sec • 35% decrease in avg response time

Slide 34

Slide 34 text

• Black Friday, 2013 • Mobile platform • 200,000,000+ users • 10 CPU cores, 28 GB RAM • < 1% CPU utilization • Deployed updates

Slide 35

Slide 35 text

Who else is using Node.js? • NASA • Netflix • Amazon • Medium • GE • Wordpress • CapitalOne • eBay • Target • Airbnb • Samsung • GoPro

Slide 36

Slide 36 text

DevOps • Small footprint • Cross-platform • Event-driven • OSS tools • Containers

Slide 37

Slide 37 text

“What is Node.js used for: The 2015 Node.js Overview Report” – blog.risingstack.com

Slide 38

Slide 38 text

Installing Node.js https://nodejs.org

Slide 39

Slide 39 text

Installing Node.js Mac or Linux? Use nvm! https://github.com/creationix/nvm Windows? Use Chocolatey! https://chocolatey.org/ C:\> choco install nodejs.install > nvm install 8

Slide 40

Slide 40 text

Installing Node.js > node –v v8.11.1 > npm –v 5.6.0

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

module-usage-example.js

Slide 43

Slide 43 text

module-usage-example.js

Slide 44

Slide 44 text

module-usage-example.js

Slide 45

Slide 45 text

module-usage-example.js

Slide 46

Slide 46 text

module-usage-example.js

Slide 47

Slide 47 text

callback-example-1.js

Slide 48

Slide 48 text

callback-example-1.js

Slide 49

Slide 49 text

callback-example-1.js

Slide 50

Slide 50 text

callback-example-2.js

Slide 51

Slide 51 text

callback-example-2.js

Slide 52

Slide 52 text

callback-example-2.js

Slide 53

Slide 53 text

callback-example-2.js

Slide 54

Slide 54 text

callback-example-3.js

Slide 55

Slide 55 text

callback-example-3.js

Slide 56

Slide 56 text

callback-example-3.js

Slide 57

Slide 57 text

callback-example-3.js

Slide 58

Slide 58 text

temperature.js

Slide 59

Slide 59 text

temperature.js

Slide 60

Slide 60 text

temperature.js

Slide 61

Slide 61 text

temperature.js

Slide 62

Slide 62 text

temperature.js temp-example.js

Slide 63

Slide 63 text

temperature.js temp-example.js

Slide 64

Slide 64 text

temperature.js temp-example.js

Slide 65

Slide 65 text

temperature.js temp-example.js

Slide 66

Slide 66 text

temperature.js temp-example.js

Slide 67

Slide 67 text

config.js

Slide 68

Slide 68 text

config.js

Slide 69

Slide 69 text

config.js

Slide 70

Slide 70 text

config.js

Slide 71

Slide 71 text

config.js

Slide 72

Slide 72 text

config.js

Slide 73

Slide 73 text

config.js

Slide 74

Slide 74 text

config.js cfg-example.js

Slide 75

Slide 75 text

config.js cfg-example.js

Slide 76

Slide 76 text

config.js cfg-example.js

Slide 77

Slide 77 text

config.js cfg-example.js

Slide 78

Slide 78 text

config.js cfg-example.js

Slide 79

Slide 79 text

config.js cfg-example.js app.json

Slide 80

Slide 80 text

sql-example.js

Slide 81

Slide 81 text

sql-example.js

Slide 82

Slide 82 text

sql-example.js

Slide 83

Slide 83 text

sql-example.js

Slide 84

Slide 84 text

sql-example.js

Slide 85

Slide 85 text

sql-example2.js

Slide 86

Slide 86 text

sql-example2.js

Slide 87

Slide 87 text

sql-example2.js

Slide 88

Slide 88 text

Deploying • Windows – iisnode for web apps – winser for services • Linux – forever • Docker

Slide 89

Slide 89 text

Hosting Node.js on Azure • New Node JS Empty Site • Connect to repository • reverentgeek.com/hosting-node-js-on-microsoft-azure/

Slide 90

Slide 90 text

Recommended toolbox Package What it do, yo lodash JavaScript utilities async async/parallel execution request, axios, or wreck http clients socket.io sockets, real-time jest, mocha, or lab test frameworks testdouble spies, stubs, mocks

Slide 91

Slide 91 text

Node frameworks MVC • Express • hapi • koa • Meteor • Sails API • Restify • LoopBack nodeframework.com

Slide 92

Slide 92 text

• Run .NET in-process • …including F#, ADO.NET, Python, and Powershell • Execute inline code, files, or assemblies • Alternative to writing native modules in C • .NET 4.5 or Mono 3.1

Slide 93

Slide 93 text

What can Edge.js do? • Leverage existing .NET investment • TFS, SharePoint, Exchange, etc. • Active Directory • Hardware (e.g. camera, microphone, printer, win32) • Video encoding, or other CPU- intensive work • Powershell

Slide 94

Slide 94 text

Node.js Integration Strategies • Node.js as proxy or nginx • request module to call APIs • Messaging (e.g. RabbitMQ, ZeroMQ Azure Service Bus) • Edge.js for .NET

Slide 95

Slide 95 text

No content

Slide 96

Slide 96 text

http://bit.ly/node-crash-course