1.3.1 • Published 4 years ago
console-sovereign v1.3.1
Author
Developed by Shree Krishna Suwal.
Example Usage
import Consoler from 'consoler-sovereign'
let consoler = new Consoler()
.default(options => {
console.log('running default command...');
console.log(options);
})
.command('manga', () => console.log('downloading manga'))
.extend('kissmanga', () => console.log('this is kissmanga...'))
.option('link', {alias: 'l'}).option('all', {alias:'a',type:'boolean'})
.orphan('manga_name', 0, { type:'string', alias:'ma' })
.run()
Terminologies
Following are the terms that you should be familiar with before getting started:
- command
- option
- orphan
Command
It is a string representing a command. Example: dl
or download
for a command that might perform download action.
option
It's a type of 'option' which requires its name to be specified to provide its value. Example:
--link https://www.youtube.com
orphan
It's a type of 'option' which does not require its name to be specified to provide its value. Example:
download https://www.youtube.com/something
Here download
is a command and https://www.youtube.com/something
is an option that doesn't need any name (which i call it an orphan
).