Skip to content

Exponential-Workload/posixparser

Repository files navigation

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

About

Parse Posix-Style Arguments in TypeScript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published