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
400
3
Share
Building Command Line Interfaces In Node.JS
http://lanyrd.com/2012/lnug-april/
domharrington
May 11, 2012
Other Decks in Programming
See All in Programming
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
150
AIエージェントと協働するCLI開発 — BunとOpenClawで学んだこと
yoshikouki
1
230
These Five Tricks Can Make Your Apps Greener, Cheaper, & Nicer
hollycummins
0
260
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
230
Claspは野良GASの夢をみるか
takter00
0
150
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
430
TypeScriptだけでAIエージェントを作る フロント・エージェント・インフラのフルスタック実践
har1101
6
1.2k
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
120
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
210
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
300
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
110
Oxlintのカスタムルールの現況
syumai
5
940
Featured
See All Featured
Color Theory Basics | Prateek | Gurzu
gurzu
0
320
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
160
Six Lessons from altMBA
skipperchong
29
4.3k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
420
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
340
AI: The stuff that nobody shows you
jnunemaker
PRO
7
670
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Typedesign – Prime Four
hannesfritz
42
3.1k
Technical Leadership for Architectural Decision Making
baasie
3
390
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
540
The Curious Case for Waylosing
cassininazir
1
370
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?