Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Node.js Development in 2020: trends and techniques
Search
Nikita Galkin
November 08, 2019
Programming
580
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Node.js Development in 2020: trends and techniques
Nikita Galkin
November 08, 2019
More Decks by Nikita Galkin
See All by Nikita Galkin
React applications Failures
galkin
0
310
Node.js Development in 2022
galkin
0
860
Cloud Native Approach for Node.js Developers
galkin
0
100
Deep Dive Into NestJS at FWDays
galkin
0
540
Node.js Recipes: Road to Production.
galkin
0
210
Auth for React.js App
galkin
1
170
Web Developer Toolbox at 2020
galkin
1
250
Backend For Frontend: The Missing Manual at Devoxx Ukraine
galkin
1
180
The Twelve-Factor App for Node.js Developers at KharkivJS
galkin
0
400
Other Decks in Programming
See All in Programming
Hatena Engineer Seminar #37「言語モデルの活用に関する研究」
slashnephy
0
460
ローカルLLMでどこまでコードが書けるか -縮小版 / How much code can be written on a local LLM Shortened
kishida
2
170
才能?センス?知らん、 続けたもん勝ちだ。-- 結婚・出産・癌を越えてなお、私がプロダクトを創り続ける理由
16bitidol
2
640
LaravelLive Japan の裏方のすべて — 第188回 PHP勉強会@東京 (2026-06-24)
suguruooki
2
140
技術記事、 専門家としてのプログラマ、 言語化
mizchi
14
7.2k
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
430
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.3k
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
780
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
190
トークンをケチるな、設計しろ:GitHub Copilotを賢く使うコンテキスト戦略
ochtum
0
270
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
140
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
270
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
How to Talk to Developers About Accessibility
jct
2
270
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
320
Context Engineering - Making Every Token Count
addyosmani
9
1k
So, you think you're a good person
axbom
PRO
2
2.1k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
160
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
480
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Transcript
Node.js Development in 2020: trends and techniques by Nikita Galkin
Nov 8, 2019
What anniversary is today?
None
None
Why Node.js won the market? 1. Everybody knows JavaScript 2.
Everybody loves Open Source 3. Google pay for V8 4. Performance boost every release 5. There is a release schedule
None
nvm install 12.13.0 nvm alias default 12.13.0 nvm reinstall-packages 10.16.3
Migrate your local version easy with nvm:
Node.js v12 Breaking changes
None
None
Breaking change at Event Loop for Timers and Microtasks
setTimeout(() => console.log('timeout1')); setTimeout(() => { console.log('timeout2'); Promise.resolve().then(() => console.log('promise
resolve') ); }); setTimeout(() => console.log('timeout3')); setTimeout(() => console.log('timeout4'));
None
6.8 ➜ 7.7
➜ ~ nvm use v10 Now using node v10.16.3 (npm
v6.9.0) ➜ ~ node --print process.versions.v8 6.8.275.32-node.54 ➜ ~ nvm use v12 Now using node v12.13.0 (npm v6.12.0) ➜ ~ node --print process.versions.v8 7.7.299.13-node.12 6.8 ➜ 7.7
const array = []; for (let i = 1; i
< 10000; i++) array.push(i); console.time('assign'); const assign = array.reduce( (acc, curr) => Object.assign(acc, {[curr]: curr}), {}); console.timeEnd('assign'); console.time('spread'); const spread = array.reduce( (acc, curr) => ({...acc, [curr]: curr}), {}); console.timeEnd('spread');
None
1. Faster JavaScript parsing 2. Faster async functions and promises
3. Zero-cost async stack traces
const { promisify } = require('util'); const wait = promisify(setTimeout);
async function testAsyncStacktrace() { await wait(10); await willDie(); return 42; } async function willDie() { await Promise.resolve(); throw new Error('#Feelsbadman'); } testAsyncStacktrace() .catch(error => console.log(error.stack));
None
By default stack-trace is 10 On CLI level ➜ ~
node async-stack-trace.js \ --stack-trace-limit=1000 On code level Error.stackTraceLimit = Infinity; More
Node.js features
Node.js v12 disappointments 1. ECMAScript Modules support is not stable.
Again. 2. Most native modules are callback based. Only fs and dns modules have promises.
JavaScript designed for browser where a failure affects only one
tab, only one user. But at Node.js failing affect everything...
Worker Threads are no longer experimental!
None
New http parser llhttp based on llparse
1. You use it! 2. For your own parser 3.
TypeScript Why learn how it works?
native Promises
1. Faster JavaScript parsing 2. Faster async functions and promises
3. Zero-cost async stack traces
What need to know: 1. promisify from util 2. once
from events 3. Reading streams asynchronously
function wait(timeout) { return new Promise(resolve => { setTimeout(resolve, timeout));
}); } // VS const util = require('util'); const wait = util.promisify(setTimeout);
const { EventEmitter } = require('events'); const emitter = new
EventEmitter(); async function getPromise() { return new Promise(resolve => { emitter.once('eventName', resolve); }) }
const { EventEmitter } = require('events'); const { once }
= require('events'); const emitter = new EventEmitter(); async function getPromise() { return once( emitter, 'eventName'); }
const { EventEmitter } = require('events'); const emitter = new
EventEmitter(); async function getPromise() { return new Promise(resolve => { emitter.once('eventName', resolve); }) }
async function main(filePath) { const readStream = fs.createReadStream(filePath); for await
(const chunk of readStream) { console.log('>>> '+chunk); } console.log('### DONE ###'); }
What need to use: 1. Promise.all/Promise.race 2. p-limit 3. multipleResolves
from process
Next big thing is QUIC/HTTP3
None
Node.js news
1. Node.js Foundation and JS Foundation Merge to Form OpenJS
Foundation 2. Node.js certification 3. Nodejs.dev arrived
None
1. Boolean 2. Null 3. Undefined 4. Number 5. String
6. Symbol 7. Object Data types in JavaScript.
1. Boolean 2. Null 3. Undefined 4. Number 5. String
6. Symbol 7. Object 8. BigInt Data types in JavaScript.
Not only Node.js news
1. TC39 new proposals 2. GraphQL is not hype and
has foundation. 3. Nestjs is the most promising framework
TypeScript 3.7
None
HAPPY NODE.JS DEVELOPMENT! You can find me on Twitter as
@galk_in Slides are available at speakerdeck.com/galkin or at my site galk.in