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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
180
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
300
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.8k
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
620
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.6k
Implementation Patterns
denyspoltorak
0
290
Patterns of Patterns
denyspoltorak
0
1.4k
Data-Centric Kaggle
isax1015
2
770
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
170
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
390
CSC307 Lecture 07
javiergs
PRO
0
550
Featured
See All Featured
Un-Boring Meetings
codingconduct
0
200
Docker and Python
trallard
47
3.7k
Agile that works and the tools we love
rasmusluckow
331
21k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
140
Google's AI Overviews - The New Search
badams
0
910
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
300
The Curse of the Amulet
leimatthew05
1
8.6k
A better future with KSS
kneath
240
18k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
How GitHub (no longer) Works
holman
316
140k
Claude Code のすすめ
schroneko
67
210k
Paper Plane (Part 1)
katiecoart
PRO
0
4.2k
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!