-
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(nodecli): commanderをコードから削除 * refactor: commanderのインストールを削除、セットアップセクションを追加 * fix: commanderをparseArgに置き換える * fix * fix * fix: main-3.jsは利用しな苦なった * fix * fix * fix * fix order * fix: node:fsに統一 * `node:`をコラムに移動 * fix * fix * fix * fix * fix * remove empty line * fix * fix * npm link * link * fix * fix * fix * シンプルに * 標準モジュールはインストールが不要なことを明記 * fix
- Loading branch information
Showing
25 changed files
with
288 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
// commanderモジュールからprogramオブジェクトをインポートする | ||
import { program } from "commander"; | ||
import * as util from "node:util"; | ||
|
||
// コマンドライン引数をcommanderでパースする | ||
program.parse(process.argv); | ||
|
||
// ファイルパスをprogram.args配列から取り出す | ||
const filePath = program.args[0]; | ||
// コマンドライン引数をparseArgs関数でパースする | ||
const { | ||
positionals | ||
} = util.parseArgs({ | ||
// オプションやフラグ以外の引数を渡すことを許可する | ||
allowPositionals: true | ||
}); | ||
// ファイルパスをpositionals配列から取り出す | ||
const filePath = positionals[0]; | ||
console.log(filePath); |
13 changes: 1 addition & 12 deletions
13
source/use-case/nodecli/argument-parse/src/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
source/use-case/nodecli/argument-parse/src/package.install.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,5 @@ | |
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"commander": "^9.0.0" | ||
} | ||
"dependencies": {} | ||
} |
Oops, something went wrong.