Pro Yearly is on sale from $80 to $50! »

Node.js Crash Course - KCDC 2019

Node.js Crash Course - KCDC 2019

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?

You will come away from this talk with the evidence to support Node.js, and tools you need to be productive. We will walk through a typical workflow of creating and debugging a web application. You will learn how easy it is to deploy, including Microsoft Azure. We'll also look at popular frameworks and modules, and other learning resources to give you the best start.

3ab1249be442027903e1180025340b3f?s=128

David Neal

July 18, 2019
Tweet

Transcript

  1. None
  2. None
  3. None
  4. None
  5. None
  6. None
  7. None
  8. None
  9. None
  10. None
  11. None
  12. None
  13. None
  14. None
  15. None
  16. None
  17. None
  18. None
  19. None
  20. None
  21. None
  22. None
  23. None
  24. None
  25. None
  26. None
  27. None
  28. None
  29. Up Ahead • Why Node.js? • Crash course • Tools

    and frameworks • Integration strategies
  30. None
  31. None
  32. None
  33. None
  34. None
  35. None
  36. None
  37. None
  38. What’s my story? • ASP.NET MVC, C# • SQL Server

    + NHibernate • JavaScript + JQuery
  39. None
  40. None
  41. What’s my story? • JavaScript • Recruiting • Productive, less

    friction – Testing – Microservices – RabbitMQ, redis – Cross-platform
  42. None
  43. 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
  44. Why Node.js? productivity satisfaction performance lower costs Improved results year-over-year

    2017 Node.js Foundation User Survey, Executive Summary
  45. Node.js exemplifies… • Start with the simplest solution that works

    • Do one thing, and do it well
  46. • Backend API for SPAs, Mobile apps, etc. • “Serverless”

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

    computing • Real-time, streaming • WebSockets, push notifications • Chat, IM, social media Node.js Use Cases
  48. More than just backend • Automation Scripts (DevOps) • CLI

    tools (compile with nexe) • Microservices • Internet of Things • Desktop Apps
  49. Slack Visual Studio Code

  50. Fandango • dramatically shorter development cycles • micro-services architecture •

    flexibility in deployment • easily scalable infrastructure “Fandango Goes Live with Node.js” – nearform.com
  51. • 2x faster development with fewer developers • 33% fewer

    lines of code • 40% fewer files • 2x improvement requests/sec • 35% decrease in avg response time
  52. • Black Friday, 2013 • Mobile platform • 200,000,000+ users

    • 10 CPU cores, 28 GB RAM • < 1% CPU utilization • Deployed updates
  53. DevOps • Small footprint • Cross-platform • Event-driven • OSS

    tools • Containers
  54. Installing Node.js https://nodejs.org

  55. 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 12
  56. Installing Node.js > node –v v12.6.0 > npm –v 6.9.0

  57. module-usage-example.js

  58. module-usage-example.js

  59. module-usage-example.js

  60. module-usage-example.js

  61. module-usage-example.js

  62. callback-example-1.js

  63. callback-example-1.js

  64. callback-example-1.js

  65. callback-example-2.js

  66. callback-example-2.js

  67. callback-example-2.js

  68. callback-example-2.js

  69. callback-example-3.js

  70. callback-example-3.js

  71. callback-example-3.js

  72. callback-example-3.js

  73. temperature.js

  74. temperature.js

  75. temperature.js

  76. temperature.js

  77. temperature.js temp-example.js

  78. temperature.js temp-example.js

  79. temperature.js temp-example.js

  80. temperature.js temp-example.js

  81. temperature.js temp-example.js

  82. config.js

  83. config.js

  84. config.js

  85. config.js

  86. config.js

  87. config.js

  88. config.js

  89. config.js cfg-example.js

  90. config.js cfg-example.js

  91. config.js cfg-example.js

  92. config.js cfg-example.js

  93. config.js cfg-example.js

  94. config.js cfg-example.js app.json

  95. sql-example.js

  96. sql-example.js

  97. sql-example.js

  98. sql-example.js

  99. sql-example.js

  100. sql-example2.js

  101. sql-example2.js

  102. sql-example2.js

  103. None
  104. Recommended toolbox Package What it do, yo nodemon automatically restarts

    in dev jest, mocha, or lab test frameworks testdouble spies, stubs, mocks eslint lint and format rules for JavaScript request, axios, or wreck http clients socket.io sockets, real-time
  105. Node frameworks MVC • Express • hapi • koa •

    total.js API • Restify • Nest • LoopBack nodeframework.com
  106. 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
  107. None
  108. https://bit.ly/node-crash-course