flagging

v1.0.1
A Regex-based flag library


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.

npm i flagging

Metadata

  • MIT
  • Whatever
  • A Furry Account
  • released 7/10/2020

Downloads

Maintainers