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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
1
550
These Five Tricks Can Make Your Apps Greener, Cheaper, & Nicer
hollycummins
0
260
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
5.1k
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.4k
タクシーアプリ『GO』の バックエンド開発のおける AI利活用と若者のすべて
pyama86
3
1.8k
自動レビューエンジンの実装と運用 ~レビューのない世界へ~
kurukuru1999
2
310
JJUG CCC 2026 Spring: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
130
ECR拡張スキャンでSBOMを収集して サプライチェーン攻撃の影響調査を 爆速で終わらせてみた
akihisaikeda
2
210
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
12
3.2k
SPMマルチモジュールで テストカバレッジを取得する技法
yosshi4486
0
140
OSもどきOS
arkw
0
370
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
2
350
Featured
See All Featured
Bash Introduction
62gerente
615
210k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
150
Mind Mapping
helmedeiros
PRO
1
220
Navigating Team Friction
lara
192
16k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
200
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
370
Are puppies a ranking factor?
jonoalderson
1
3.5k
Chasing Engaging Ingredients in Design
codingconduct
0
200
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?