Skip to content
/ ticli Public

Zero dependencies, very tiny, nodejs command line argument parser.

Notifications You must be signed in to change notification settings

fatmatto/ticli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Ticli (TIny CLI)

Zero dependencies, very tiny, nodejs command line argument parser.

Installation

npm i @fatmatto/ticli

Basic usage

Run the following as node script.js help and node script.js echoParams --thing foo --secure

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

About

Zero dependencies, very tiny, nodejs command line argument parser.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published