Skip to content

Latest commit

 

History

History
22 lines (22 loc) · 527 Bytes

README.md

File metadata and controls

22 lines (22 loc) · 527 Bytes

@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');