flagging

A Regex-based flag library

Usage no npm install needed!

<script type="module">
  import flagging from 'https://cdn.skypack.dev/flagging';
</script>

README


Flagging

A simple library to parse and process flags in JavaScript strings.

Setup

Yarn: yarn add flagging NPM: npm i flagging

Example

import * as flagging from "flagging";

let res = flagging.process("--verbose -scale 22 --method fast", {
    parseNumbers: true
})

// Returns:
{
    verbose: ["verbose"],
    scale: ["scale", 22],
    method: ["method", "fast"]
}

Contributions

Contribute, steal, republish, I don't care! As long as my code gets some sort of use i'm happy.