We are building a feature-rich flag parser.
If you are new to flag parsing. Check the following below:
npm installnpm run build
node build/src/index.js -p hello -i world-p and -h are flags.
Value of flag p is hello
Value of flag h is world
To run the project locally.
- Clone the repo:
git clone https://git clone https://github.com/imabp/flagparser.git - Intall packages:
npm install - Run the project:
npm run dev -- -exampleFlag helloworld - Expected Output
{ '-exampleFlag': 'helloworld' }
npx ts-node src/index.ts -exampleFlag helloworldto run on localnpm run watchto continuously watch your codenpm run lintto check your code is clean from error & warningsnpm run fixto fix errors & warnings
Structure
.
├── package.json
├── package-lock.json
├── tsconfig.json
├── README.md
├── .eslintrc.json
├── .prettierrc.js
├── .gitignore
├── .eslintignore
└── src
├── index.ts
├── type.ts