@zhinjs/directive
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @zhinjs/directive

Weekly Downloads

217

Version

0.1.4

License

ISC

Unpacked Size

22.2 kB

Total Files

9

Last publish

Collaborators

  • lc_cn
  • guhuan
  • vikiboss