Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Node.js Crash Course - KCDC 2018

David Neal
July 12, 2018
620

Node.js Crash Course - KCDC 2018

Node.js is a compelling platform that is quickly spreading from startups to the enterprise. Node.js strategically unites developers of all backgrounds through the common language of JavaScript. Why should you learn Node.js and where do you start?

David Neal

July 12, 2018
Tweet

More Decks by David Neal

Transcript

  1. Any application that can be written in JavaScript… …will eventually

    be written in JavaScript (search for “jslinux”) Atwood’s Law:
  2. Up Ahead • Why Node.js? • Crash course • Tools

    and frameworks • Integration strategies
  3. What’s my story? • ASP.NET MVC, C# • SQL Server

    + NHibernate • JavaScript + JQuery
  4. What’s my story? • JavaScript • Recruiting • Productive, less

    friction – Testing – Microservices – RabbitMQ, redis – Cross-platform
  5. 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
  6. • 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
  7. 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
  8. More than just backend • Create Automation Scripts • Internet

    of Things • Create CLI tools using nexe • Create Desktop Apps
  9. Fandango • dramatically shorter development cycles • micro-services architecture •

    flexibility in deployment • easily scalable infrastructure “Fandango Goes Live with Node.js” – nearform.com
  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. • Black Friday, 2013 • Mobile platform • 200,000,000+ users

    • 10 CPU cores, 28 GB RAM • < 1% CPU utilization • Deployed updates
  12. Who else is using Node.js? • NASA • Netflix •

    Amazon • Medium • GE • Wordpress • CapitalOne • eBay • Target • Airbnb • Samsung • GoPro
  13. 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
  14. Recommended toolbox Package What it do, yo nodemon automatically restarts

    in dev 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
  15. Node frameworks MVC • Express • hapi • koa •

    Meteor • Sails API • Restify • LoopBack nodeframework.com
  16. Deploying • Windows – iisnode for web apps – winser

    for services • Linux – forever • Docker
  17. • 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
  18. 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
  19. 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