@minimistjs/subarg

Parse arguments with recursive contexts and nested subcommands

npmmacoslinuxwindows
Try with needOr install directly
Source

About

parse arguments with recursive contexts

Commands

subarg

Examples

Parse nested command arguments with subarg module$ node -e "const subarg = require('@minimistjs/subarg'); console.log(subarg(['cmd', '--flag', 'value']))"
Parse arguments with recursive contexts for subcommands$ node -e "const subarg = require('@minimistjs/subarg'); console.log(subarg(['deploy', '--env', 'prod', 'notify', '--slack', 'true']))"
Parse deeply nested command structures$ node -e "const subarg = require('@minimistjs/subarg'); const args = subarg(['git', 'config', '--global', 'user.name', 'John']); console.log(JSON.stringify(args, null, 2))"