@zhinjs/directive

a simple raw directive parser for javascript/typescript


Keywords
directive, command
License
ISC
Install
npm install @zhinjs/directive@0.1.1

Documentation

@zhinjs/directive

  • a simple raw directive parser for nodejs

install

npm install @zhinjs/directive
# or
yarn add @zhinjs/directive
# or
pnpm add @zhinjs/directive

usage

import { Directive } from '@zhinjs/directive'
const directive = new Directive('hello')
    .arg('string',{required:true})
    .arg('number',{inititalValue:0})
    .option('foo','boolean',{alias:'f'})
    .handle(async ({args, options})=>{
        console.log(args, options);
    });
directive.match('hello "world" -f');