We are building a feature-rich flag parser.
If you are new to flag parsing. Check the following below:
npm install
npm 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 helloworld
to run on localnpm run watch
to continuously watch your codenpm run lint
to check your code is clean from error & warningsnpm run fix
to fix errors & warnings
Structure
.
βββ package.json
βββ package-lock.json
βββ tsconfig.json
βββ README.md
βββ .eslintrc.json
βββ .prettierrc.js
βββ .gitignore
βββ .eslintignore
βββ src
βββ index.ts
βββ type.ts