Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fatmatto/ticli
Zero dependencies, very tiny, nodejs command line argument parser.
https://github.com/fatmatto/ticli
cli nodejs
Last synced: 1 day ago
JSON representation
Zero dependencies, very tiny, nodejs command line argument parser.
- Host: GitHub
- URL: https://github.com/fatmatto/ticli
- Owner: fatmatto
- Created: 2017-12-25T22:15:00.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-27T15:43:57.000Z (about 7 years ago)
- Last Synced: 2025-01-01T07:47:13.880Z (26 days ago)
- Topics: cli, nodejs
- Language: JavaScript
- Size: 12.7 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/fatmatto/ticli.svg?branch=master)](https://travis-ci.org/fatmatto/ticli)
# Ticli (TIny CLI)
Zero dependencies, very tiny, nodejs command line argument parser.## Installation
```bash
npm i @fatmatto/ticli
```## Basic usage
Run the following as `node script.js help` and `node script.js echoParams --thing foo --secure````javascript
const Cli = require('../index')let program = new Cli()
program.registerParam('thing')
.alias('-t')
.alias('--thing')
.describe('The parameter you need to do your thing')program.registerFlag('secure')
.alias('-s')
.alias('--secure')
.describe('The program will be secure')program.registerCommand('help', (program) => { program.printHelp()})
program.registerCommand('echoParams', (program) => { console.log( program.get() ) })// Optional if run() is called
program.parse()program.run()
```This example registered two commands and a parameter