Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Intro to Node.js
(for .NET Developers)
David Neal | reverentgeek.com | @reverentgeek
var trustMe = {
consumes: ["Bacon", "...
Y2K
Up Ahead
•  Why Node.js?
•  Crash course
•  Tools and frameworks
•  Deployment
JavaScript…
…has won the Web.
– Scott Hanselman
Anything that can be
written in JavaScript…
…will eventually be written in JavaScript
– Somebody with incredible powers of...
JavaScript…
…is tragically important.
– Douglas Crockford,
Author of“JavaScript: The Good Parts”
Node.js exemplifies…
Start with the simplest
solution that works.
Do one thing,
and do it well.
Node.js is…
•  blazing fast
•  highly concurrent
•  low-friction
•  cross-platform
•  modern web server
Why Node.js?
•  Rapid innovation & delivery
•  Developer happiness
•  Attract & retain talent
•  Performance
“Why Node.js ...
•  2x faster development with fewer developers
•  33% fewer lines of code
•  40% fewer files
•  2x improvement requests/sec...
“We are seeing big scale gains, performance
boosts and big developer productivity.”
•  Black Friday, 2013
•  Mobile platform
•  < 1% CPU utilization
•  200,000+ concurrent users
NBC Universal
•  ASP.NET to Node.js
•  300 million page views/month
•  Start render time: 8.8 to 1.3 seconds
•  Page speed...
Who else is using Node.js?
•  Dow Jones (WSJ)
•  eBay
•  Groupon
•  LinkedIn
•  Rdio
•  Shutterstock
•  The New York Times...
Node.js Use Cases
•  Single-page apps
•  API server (REST, Hypermedia, etc.)
•  Real-time, streaming, WebSockets
•  Chat, ...
io.js
•  Fork of node.js
•  Latest Chrome V8, ES6
•  Open governance
What’s our story?
•  ASP.NET MVC, C#
•  SQL Server + NHibernate
•  JavaScript + JQuery
What’s our story?
•  JavaScript
•  Recruiting
•  Productive, less friction
–  Testing
–  Microservices
–  RabbitMQ, riak, ...
Ready to jump in?
Installing Node.js
1.  http://nodejs.org
2.  Click big, green INSTALL
3.  Run installer
– OR –
Install using Chocolatey (h...
Installing Node.js
C:> node –v
v0.10.38
C:> npm –v
1.4.28
	
  
Dependencies
– OR –
Python 2.x (https://python.org/downloads/
C:> choco install python2
	
  
Dependencies
– OR –
Visual C++ 2010 Express
C:> choco install VCExpress2010
	
  
Node.js Tools for Visual Studio
Minimum requirements
•  VS 2012 Pro
or VS 2013 Express
•  Latest VS updates
http://nodejst...
Hey y’all
watch this…
Other editors
•  Sublime Text 3
•  Atom
•  WebStorm
Debugging
C:> node debug hello.js	
  
Debugging
C:> node debug hello.js	
  
Debugging
C:> npm install –g node-inspector	
  
Debugging
C:> node install –g node-inspector	
  
C:> node-debug hello.js	
  
Deploying
•  Don’t include node_modules folder
•  …unless you create builds for specific targets
•  Azure is super-easy
•  ...
Hosting Node.js on Azure
reverentgeek.com/hosting-node-js-on-microsoft-azure/
Recommended Toolbox
Package What it do, yo
lodash JavaScript utilities
when JavaScript promise library
async async/paralle...
Node frameworks
MVC
•  Express
•  Meteor
•  Sails
•  Hapi
API
•  Restify
•  LoopBack
•  Autohost
nodeframework.com
nodeweb...
Edge.js
•  Run .NET in-process
•  …including F#, ADO.NET, Python,
and Powershell
•  Execute inline code, files, or
assembli...
What can Edge.js do?
•  Leverage existing .NET investment
•  SQL Server (or other DBs)
•  TFS, SharePoint, Exchange, etc.
...
.NET + Node.js Integration
•  Edge.js (possible migration strategy)
•  request module to call .NET Web Services
•  Messagi...
Thank you!
David Neal
@ReverentGeek
david@reverentgeek.com
reverentgeek.com
Demos + Resources
bit.ly/node-demos
Please rat...
Intro to Node.js (for .NET Developers)
Intro to Node.js (for .NET Developers)
Intro to Node.js (for .NET Developers)
Intro to Node.js (for .NET Developers)
Intro to Node.js (for .NET Developers)
Intro to Node.js (for .NET Developers)
Intro to Node.js (for .NET Developers)
Intro to Node.js (for .NET Developers)
Intro to Node.js (for .NET Developers)
Intro to Node.js (for .NET Developers)
Intro to Node.js (for .NET Developers)
Intro to Node.js (for .NET Developers)
Intro to Node.js (for .NET Developers)
Intro to Node.js (for .NET Developers)
Intro to Node.js (for .NET Developers)
Intro to Node.js (for .NET Developers)
Intro to Node.js (for .NET Developers)
Upcoming SlideShare
Loading in …5
×

Intro to Node.js (for .NET Developers)

2,814 views

Published on

Node.js is a compelling platform that is quickly spreading from startups to the enterprise. As a .NET developer, why should you learn Node.js and where do you start? You will come away from this talk with the evidence and tools you need to be a productive Node.js developer. We'll walk through creating, debugging, and deploying a Node.js project to Microsoft Azure using the Node.js Tools for Visual Studio. We'll also look at popular frameworks and modules, and other learning resources.

Published in: Software

Intro to Node.js (for .NET Developers)

  1. 1. Intro to Node.js (for .NET Developers) David Neal | reverentgeek.com | @reverentgeek var trustMe = { consumes: ["Bacon", "Caffeine"], hasBeard: true, knowsHowToComputer: true }
  2. 2. Y2K
  3. 3. Up Ahead •  Why Node.js? •  Crash course •  Tools and frameworks •  Deployment
  4. 4. JavaScript… …has won the Web. – Scott Hanselman
  5. 5. Anything that can be written in JavaScript… …will eventually be written in JavaScript – Somebody with incredible powers of observation (e.g., search for“jslinux”)
  6. 6. JavaScript… …is tragically important. – Douglas Crockford, Author of“JavaScript: The Good Parts”
  7. 7. Node.js exemplifies… Start with the simplest solution that works. Do one thing, and do it well.
  8. 8. Node.js is… •  blazing fast •  highly concurrent •  low-friction •  cross-platform •  modern web server
  9. 9. 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
  10. 10. •  2x faster development with fewer developers •  33% fewer lines of code •  40% fewer files •  2x improvement requests/sec •  35% decrease in avg response time
  11. 11. “We are seeing big scale gains, performance boosts and big developer productivity.”
  12. 12. •  Black Friday, 2013 •  Mobile platform •  < 1% CPU utilization •  200,000+ concurrent users
  13. 13. NBC Universal •  ASP.NET to Node.js •  300 million page views/month •  Start render time: 8.8 to 1.3 seconds •  Page speed: 100+ to <10 seconds NBC News, Today.com, CNN…
  14. 14. Who else is using Node.js? •  Dow Jones (WSJ) •  eBay •  Groupon •  LinkedIn •  Rdio •  Shutterstock •  The New York Times •  Uber •  Yammer •  Zendesk nodjs.org/industry
  15. 15. Node.js Use Cases •  Single-page apps •  API server (REST, Hypermedia, etc.) •  Real-time, streaming, WebSockets •  Chat, IM, social media •  Dashboards •  Proxy service In other words… the INTERNET
  16. 16. io.js •  Fork of node.js •  Latest Chrome V8, ES6 •  Open governance
  17. 17. What’s our story? •  ASP.NET MVC, C# •  SQL Server + NHibernate •  JavaScript + JQuery
  18. 18. What’s our story? •  JavaScript •  Recruiting •  Productive, less friction –  Testing –  Microservices –  RabbitMQ, riak, redis •  Cross-platform
  19. 19. Ready to jump in?
  20. 20. Installing Node.js 1.  http://nodejs.org 2.  Click big, green INSTALL 3.  Run installer – OR – Install using Chocolatey (http://chocolatey.org) C:> choco install nodejs.install  
  21. 21. Installing Node.js C:> node –v v0.10.38 C:> npm –v 1.4.28  
  22. 22. Dependencies – OR – Python 2.x (https://python.org/downloads/ C:> choco install python2  
  23. 23. Dependencies – OR – Visual C++ 2010 Express C:> choco install VCExpress2010  
  24. 24. Node.js Tools for Visual Studio Minimum requirements •  VS 2012 Pro or VS 2013 Express •  Latest VS updates http://nodejstools.codeplex.com
  25. 25. Hey y’all watch this…
  26. 26. Other editors •  Sublime Text 3 •  Atom •  WebStorm
  27. 27. Debugging C:> node debug hello.js  
  28. 28. Debugging C:> node debug hello.js  
  29. 29. Debugging C:> npm install –g node-inspector  
  30. 30. Debugging C:> node install –g node-inspector   C:> node-debug hello.js  
  31. 31. Deploying •  Don’t include node_modules folder •  …unless you create builds for specific targets •  Azure is super-easy •  Windows –  iisnode for web apps –  winser for services •  Linux – forever
  32. 32. Hosting Node.js on Azure reverentgeek.com/hosting-node-js-on-microsoft-azure/
  33. 33. Recommended Toolbox Package What it do, yo lodash JavaScript utilities when JavaScript promise library async async/parallel execution request (or rest) http client gulp build engine, test runner socket.io sockets, real-time node-inspector Debugging mocha test framework chai TDD/BDD assertion library sinon spies, stubs, mocks
  34. 34. Node frameworks MVC •  Express •  Meteor •  Sails •  Hapi API •  Restify •  LoopBack •  Autohost nodeframework.com nodewebmodules.com
  35. 35. Edge.js •  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
  36. 36. What can Edge.js do? •  Leverage existing .NET investment •  SQL Server (or other DBs) •  TFS, SharePoint, Exchange, etc. •  Active Directory •  Hardware (e.g. camera, microphone, printer, win32) •  Video encoding, or other CPU-intensive work •  Powershell
  37. 37. .NET + Node.js Integration •  Edge.js (possible migration strategy) •  request module to call .NET Web Services •  Messaging (e.g. RabbitMQ)
  38. 38. Thank you! David Neal @ReverentGeek david@reverentgeek.com reverentgeek.com Demos + Resources bit.ly/node-demos Please rate me! h#p://spkr8.com/t/54801  

×