Node.js Crash Course - All Things Open 2018

3ab1249be442027903e1180025340b3f?s=47 David Neal
October 22, 2018
190

Node.js Crash Course - All Things Open 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? 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. We’ll also look at popular frameworks and modules, and other learning resources to give you the best start.

3ab1249be442027903e1180025340b3f?s=128

David Neal

October 22, 2018
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. None
  30. None
  31. None
  32. None
  33. None
  34. Up Ahead • Why Node.js? • Crash course • Tools

    and frameworks • Integration strategies
  35. None
  36. None
  37. None
  38. None
  39. None
  40. None
  41. None
  42. None
  43. ES 2016 (ES6) Support https://kangax.github.io/compat-table/es6/

  44. What’s my story? • ASP.NET MVC, C# • SQL Server

    + NHibernate • JavaScript + JQuery
  45. None
  46. None
  47. What’s my story? • JavaScript • Recruiting • Productive, less

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

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

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

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

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

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

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

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

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

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

    Amazon • Medium • GE • Wordpress • CapitalOne • eBay • Target • Airbnb • Samsung • GoPro
  60. DevOps • Small footprint • Cross-platform • Event-driven • OSS

    tools • Containers
  61. “What is Node.js used for: The 2015 Node.js Overview Report”

    – blog.risingstack.com
  62. Installing Node.js https://nodejs.org

  63. 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 10
  64. Installing Node.js > node –v v10.11.0 > npm –v 6.4.1

  65. module-usage-example.js

  66. module-usage-example.js

  67. module-usage-example.js

  68. module-usage-example.js

  69. module-usage-example.js

  70. callback-example-1.js

  71. callback-example-1.js

  72. callback-example-1.js

  73. callback-example-2.js

  74. callback-example-2.js

  75. callback-example-2.js

  76. callback-example-2.js

  77. callback-example-3.js

  78. callback-example-3.js

  79. callback-example-3.js

  80. callback-example-3.js

  81. temperature.js

  82. temperature.js

  83. temperature.js

  84. temperature.js

  85. temperature.js temp-example.js

  86. temperature.js temp-example.js

  87. temperature.js temp-example.js

  88. temperature.js temp-example.js

  89. temperature.js temp-example.js

  90. config.js

  91. config.js

  92. config.js

  93. config.js

  94. config.js

  95. config.js

  96. config.js

  97. config.js cfg-example.js

  98. config.js cfg-example.js

  99. config.js cfg-example.js

  100. config.js cfg-example.js

  101. config.js cfg-example.js

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

  103. sql-example.js

  104. sql-example.js

  105. sql-example.js

  106. sql-example.js

  107. sql-example.js

  108. sql-example2.js

  109. sql-example2.js

  110. sql-example2.js

  111. None
  112. 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
  113. Node frameworks MVC • Express • hapi • koa •

    fastify API • Restify • LoopBack nodeframework.com
  114. None
  115. 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
  116. None
  117. https://bit.ly/node-crash-course

  118. None