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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
2k
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
1
970
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
700
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
290
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
580
dchart: charts from deck markup
ajstarks
3
990
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
570
AtCoder Conference 2025
shindannin
0
1.1k
MUSUBIXとは
nahisaho
0
130
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
CSC307 Lecture 07
javiergs
PRO
0
550
CSC307 Lecture 02
javiergs
PRO
1
780
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.9k
Designing for humans not robots
tammielis
254
26k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
260
Being A Developer After 40
akosma
91
590k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.1k
Un-Boring Meetings
codingconduct
0
200
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
0
3.4k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
120
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!