Skip to content

Command line interface argument parser built around the conventional GNU concept of a prefix character used to denote operands, flags, and options.

License

Notifications You must be signed in to change notification settings

SnapLib/typescript-cliofo

Repository files navigation

Cliofo (Command Line Interface Operand Flag Option)

*** THIS PROJECT IS CURRENTLY IN ALPHA STATUS AND DOES NOT HAVE ALL FEATURES IMPLEMENTED AND WILL LIKELY GO THROUGH BREAKING CHANGES! ***

npm version shield npm package license node version

npm package to implement a command line interface argument parser in a conventional GNU way. This API is built around the concept of a single leading prefix character denoting flag arguments, 2 leading adjacent identical characters denoting option arguments, and no leading prefix characters denoting operand arguments.

Installing

Running the following command will install this package as a dependency of a Node npm package:

npm i cliofo

Tests

The source code containing the unit tests for this package can be found in the ./src/test/ts directory. It mimics the directory structure of the deployable source code found in the ./src/main/ts

Running the command:

npm test

will run the unit tests and output results to stdout.

Running the command:

npm run test-report

will output the test results into a webpage and open up the webpage via a web browser. That generated webpage can be found at ./build/test-report/index.html.

This package uses the Mocha testing framework and the Chai assertion library for unit testing and mochawesome to generate the web based test report.

Linting

Linting is done for all source code found in the ./src. This includes both the deployable source code as well as the unit test source code. When a lint check is run it outputs errors and warnings to stdout.

Run the default linter via:

npm run lint

This runs a less strict lint check where all warnings are silenced.

A stricter lint can be done via:

npm run lint-strict

This is identical to the other lint command, except it doesn't silence warnings.

This package uses ESLint for linting.

TypeScript

This package's source code is all written in TypeScript. This includes the source code that actually gets transpiled to the executable JavaScript in the deployed npm package as well as the unit test source code. All the source code can be found in the ./src directory found at the root of the package repo. The unit test source code does not get transpiled to JavaScript.

Running the command:

npm run build

will output transpiled source code in a manner more suitable for developmental purposes to the ./build/dev directory.

Running the command:

npm run build-dist

will output transpiled source code in a manner more suitable for deployment to the ./build/dist directory.

Running the command:

npm run build-types

will output a TypeScript types declaration file to ./build/dist/cliofo.d.ts.

TypeDoc API Documentation

Running the command:

npm run tsdoc

will generate the documentation and output it via a webpage that can found at ./build/tsdoc/index.html. TypeDoc is used to generate the API documentation.


github shield TypeScript Mocha ESLint npm NodeJS

About

Command line interface argument parser built around the conventional GNU concept of a prefix character used to denote operands, flags, and options.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published