0.0.0 • Published 4 years ago

@kuro-chan/argument-parser v0.0.0

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

@kuro-chan/argument-parser

Installation

yarn add @kuro-chan/argument-parser
# or
npm install @kuro-chan/argument-parser

Usage

import { ArgumentParser } from '@kuro-chan/argument-parser'

const parser = new ArgumentParser({
  stringChars: [`'`, `"`],
  escapeChars: [`\\`],
  separatorChars: [' '],
  trueStrings: [`true`],
  falseStrings: [`false`]
})
const args = parser.parse(`text 'text' "text" text\\ text \\'text\\' \\"text\\" 0 10 0xff true false`)

console.log(args) //[ 'text', 'text', 'text', 'text text', '\'text\'', '"text"', 0, 10, 255, true, false ]