-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6b58aef
Showing
4 changed files
with
187 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
build | ||
npm-debug.log | ||
.env | ||
.DS_Store |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#! /usr/bin/env node | ||
const { program } = require("commander"); | ||
const path = require("path"); | ||
const fs = require("fs"); | ||
const { cwd } = require("process"); | ||
|
||
const currentDirectory = cwd(); //path.join(path.dirname(fs.realpathSync(__filename))); | ||
const configFile = require(`${currentDirectory}/package.json`); | ||
|
||
Object.keys(configFile).forEach((key) => { | ||
program | ||
.command(key) | ||
.description(`View the ${key} field in your package.json`) | ||
.action(() => { | ||
console.log(configFile[key]); | ||
}); | ||
}); | ||
|
||
program.parse(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "pk-cli", | ||
"version": "1.0.0", | ||
"description": "A CLI to manage a TODO list", | ||
"main": "index.js", | ||
"scripts": { | ||
"start": "node index.js" | ||
}, | ||
"keywords": [ | ||
"MIT" | ||
], | ||
"author": "Shahed Nasser", | ||
"license": "MIT", | ||
"dependencies": { | ||
"chalk": "^4.1.0", | ||
"commander": "^7.2.0" | ||
}, | ||
"bin": { | ||
"pk": "index.js" | ||
} | ||
} |