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
Building Command Line Interfaces In Node.JS
Search
domharrington
May 11, 2012
Programming
3
390
Building Command Line Interfaces In Node.JS
http://lanyrd.com/2012/lnug-april/
domharrington
May 11, 2012
Tweet
Share
Other Decks in Programming
See All in Programming
Deep Dive 大規模システムアーキテクチャ/開発組織エンジニアリング / Deep Dive Large-Scale System Architecture, Development Organization Engineering
nrslib
15
2.9k
品質とスピードを両立: TypeScriptの柔軟な型システムをバックエンドで活用する
kosui
5
1.1k
Enhancing Applications with Accessibility API
kishikawakatsumi
3
1k
Laravel標準バリデーションでできること
hmb_ok
2
360
WasmOS: Wasmを実行する自作Microkernel
riru
0
370
Compiling Python to WebAssembly with py2wasm
syrusakbary
0
140
デザインシステムで Tailwind CSSとCSS in JSに分散投資をしたら良かった話
fsubal
14
3.4k
チームでモデリングを育てるうえで 考えたこと・気づいたこと / Cultivating Modeling in Teams: Thoughts and Insights
mackey0225
5
2.4k
IntelliJ IDEA を知らなかった 自分に教えたい小ネタ集 / IntelliJ IDEA Hints for My Past Self
mackey0225
3
180
Prepare for Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
510
プロンプトエンジニアリング入門
tomokusaba
2
990
TCA魔法学入門🪄
dazy
0
280
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
317
37k
How To Stay Up To Date on Web Technology
chriscoyier
781
250k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
6
950
Automating Front-end Workflow
addyosmani
1353
200k
The Straight Up "How To Draw Better" Workshop
denniskardys
227
130k
Producing Creativity
orderedlist
PRO
335
39k
The Pragmatic Product Professional
lauravandoore
24
5.7k
RailsConf 2023
tenderlove
0
510
Design by the Numbers
sachag
274
18k
GraphQLとの向き合い方2022年版
quramy
28
12k
Building Better People: How to give real-time feedback that sticks.
wjessup
350
18k
Bootstrapping a Software Product
garrettdimon
PRO
302
110k
Transcript
BUILDING COMMAND LINE INTERFACES IN Node.JS 1 Copyright © 2012
Clock Limited Clock ® is a registered trademark of Clock limited in the EU and other territories Registered in England and Wales No.3457724 VAT Registered No. 706 7654 20
@domharrington 2 WHO AM I? Github: domharrington
'process' module Arguments accessible via 'process.argv' Array of arguments 3
COMMAND- LINE IN NODE
4
Perfectly fine if you only need one argument E.g. accessing
the first argument: process.argv[2] Parsing of options becomes unmanageable 5 PROBLEMS WITH THIS APPROACH
Module to help ease the pain of parsing command-line options
Simple, natural API Auto generated --help and --version 6 COMMANDER.JS https://github.com/visionmedia/commander.js/
7
8
Options don't need to be defined All options are parsed
automatically Also has default values, aliases Many more features 9 NODE-OPTIMIST https://github.com/substack/node-optimist
10
11
aparser cli node-arguments And many more … 12 SOME MORE
LIBRARIES
13 WHERE HAVE I USED IT? https://github.com/domharrington/gitme
14 ANY QUESTIONS?