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
0
81
Code Reuse in Node.js (the short version)
Makara Wang
April 20, 2013
Tweet
Share
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
84
Asynchronous JS with Promise
makara
2
150
Other Decks in Programming
See All in Programming
まだ間に合う!Claude Code元年をふりかえる
nogu66
5
920
TestingOsaka6_Ozono
o3
0
250
2年のAppleウォレットパス開発の振り返り
muno92
PRO
0
130
Cap'n Webについて
yusukebe
0
160
これならできる!個人開発のすゝめ
tinykitten
PRO
0
140
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
0
120
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
5
1.5k
20251212 AI 時代的 Legacy Code 營救術 2025 WebConf
mouson
0
230
從冷知識到漏洞,你不懂的 Web,駭客懂 - Huli @ WebConf Taiwan 2025
aszx87410
2
3.2k
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
340
PostgreSQLで手軽にDuckDBを使う!DuckDB&pg_duckdb入門/osc25hi-duckdb
takahashiikki
0
230
Navigating Dependency Injection with Metro
l2hyunwoo
1
200
Featured
See All Featured
The SEO Collaboration Effect
kristinabergwall1
0
320
Leo the Paperboy
mayatellez
0
1.3k
Getting science done with accelerated Python computing platforms
jacobtomlinson
0
85
The browser strikes back
jonoalderson
0
280
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
61
51k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Google's AI Overviews - The New Search
badams
0
880
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
110
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
38
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!