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
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
1
970
Package Management Learnings from Homebrew
mikemcquaid
0
220
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.9k
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
7.4k
Implementation Patterns
denyspoltorak
0
290
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
180
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
180
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
730
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
1
230
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
450
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
2.5k
Fluid Templating in TYPO3 14
s2b
0
130
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
190
Mind Mapping
helmedeiros
PRO
0
81
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
How to Ace a Technical Interview
jacobian
281
24k
RailsConf 2023
tenderlove
30
1.3k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
180
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
640
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
270
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
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!