Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Code Reuse in Node.js (the short version)
Search
Makara Wang
April 20, 2013
Programming
91
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
110
Asynchronous JS with Promise (+ Workshop)
makara
0
98
Asynchronous JS with Promise
makara
2
160
Other Decks in Programming
See All in Programming
R8 の設定見直しでアプリサイズ削減
andpad
0
220
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.2k
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
3
2.5k
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
170
Workers Cache を知る
syumai
0
360
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1.2k
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
130
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
490
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
490
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
270
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
210
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
24
25k
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
50
15k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Building AI with AI
inesmontani
PRO
1
1.3k
Paper Plane (Part 1)
katiecoart
PRO
2
12k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
930
Scaling GitHub
holman
464
140k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
750
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
43k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
430
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7k
What does AI have to do with Human Rights?
axbom
PRO
1
2.4k
Unsuck your backbone
ammeep
672
58k
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!