posixparser

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

Generated using TypeDoc