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
Code Reuse in Node.js (the short version)
Search
Makara Wang
April 20, 2013
Programming
81
0
Share
Code Reuse in Node.js (the short version)
Makara Wang
April 20, 2013
More Decks by Makara Wang
See All by Makara Wang
Loose Coupling with Message Queue / Bus (the short version)
makara
1
94
Asynchronous JS with Promise (+ Workshop)
makara
0
86
Asynchronous JS with Promise
makara
2
150
Other Decks in Programming
See All in Programming
今年もTECHSCOREブログを書き続けます!
hiraoku101
0
230
煩雑なSkills管理をSoC(関心の分離)により解決する――関心を分離し、プロンプトを部品として育てるためのOSSを作った話 / Solving Complex Skills Management Through SoC (Separation of Concerns)
nrslib
3
780
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
4.7k
Feature Toggle は捨てやすく使おう
gennei
0
510
事業会社でのセキュリティ長期インターンについて
masachikaura
0
230
安いハードウェアでVulkan
fadis
1
930
CursorとClaudeCodeとCodexとOpenCodeを実際に比較してみた
terisuke
1
280
まかせられるPM・まかせられないPM / DevTech GUILD Meetup
yusukemukoyama
0
110
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
990
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
160
The Monolith Strikes Back: Why AI Agents ❤️ Rails Monoliths
serradura
0
290
AWS re:Invent 2025の少し振り返り + DevOps AgentとBacklogを連携させてみた
satoshi256kbyte
2
150
Featured
See All Featured
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Test your architecture with Archunit
thirion
1
2.2k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
Raft: Consensus for Rubyists
vanstee
141
7.4k
Building AI with AI
inesmontani
PRO
1
870
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.4k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.6k
Fireside Chat
paigeccino
42
3.9k
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
Transcript
Code Reuse in Node.js (the short version) ⺩王浩宇 Makara Wang
[email protected]
2013.04.20
Assuming you know... JS & Node.js Prototype “this”
Common ways... Function + Arguments Good for: everything, promise, ...
Common ways... Prototype + Class Good for: modeling... ...or you
really care about performance ...or you want the long prototype chain
Common ways... Function Copy this[key] = that[key]; Good for: simpler
syntax, better syntax, ...
My favorite Function Copy ...with “Object.defineProperties()” Because it’s Node.js (not
a broken browser)
Implementations https://github.com/medikoo/es5-ext require('es5-ext/lib/Object/extend-properties'); https://github.com/devo-ps/carcass carcass.mixable(obj);
(Personal) Notes Use “this” Return “this” Reduce arguments Avoid “bind()”
...
Thanks!