Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
jbuck94 committed Jan 29, 2022
0 parents commit 6b58aef
Show file tree
Hide file tree
Showing 4 changed files with 187 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
build
npm-debug.log
.env
.DS_Store
19 changes: 19 additions & 0 deletions index.js
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();
142 changes: 142 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions package.json
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"
}
}

0 comments on commit 6b58aef

Please sign in to comment.