1.0.1 โ€ข Published 10 months ago

posixparser v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

PosixParser

๐Ÿ“ Documentation ๐Ÿ“ฆ NPM ๐Ÿงช Tests

Parse Posix-Style Arguments in JS - Rewrite of this old gist of mine

๐Ÿ“ฆ Table of Contents

๐Ÿš€ Setup

pnpm i posixparser

๐Ÿ› ๏ธ Usage

import PosixParser, {Options as PosixOptions} from 'posixparser'

const options = new Options({
  pushQuotes: false,
  pushEscapes: false,
  pushBlankWhitespace: false,
});

const parser = new PosixParser(options); // options can also be passed as a 2nd arg to parse()

const input = `"hello world" hello hi 'hello there'`

const output = parser.parse(input);

console.log(output); // ["hello world", "hello", "hi", "hello there"]

๐Ÿ“œ License

This project is licensed under the ๐Ÿ“„ MIT License

๐Ÿ”— See Also

1.0.1

10 months ago

1.0.0

10 months ago