- 86f2c54: Rename
setGlobals
toglobals
andsetMeta
tometa
- 86f2c54: Update docs to with shared/global options example
- 94284db: Flag options can now be configured to be one of a set of available values!
-
f08f0bb: - The utility types have all been refactored and/or replaced
- Unsafe type casts (
as unknown as T
) have been removed - Unnecessary generics have been removed
Everything else works as usual, but external declarations of handlers and globals need a little update. It's all simpler and cleaner now!
- Unsafe type casts (
- d47c225: Upgrade dependencies
- 7889049: Fix Handler utility types to preserve handler return type
- a9bfe77: Fix downcast utility type to default to
string[]
- d8767c5: Parsers now expose default options
- d8767c5: New utility types that allow for modular handler declaration!
- cf32aeb: Tinyparse is now asynchronous by default, allowing you to use async handlers and setters!
- bd1d97e: Make usage text available in handlers
- bd1d97e: Refine usage text formatting
- bd1d97e: Rename
appName
tocommand
in meta options
- f1fb8fe: - Subparsers: Added support for subparsers
- Error handling: Slight API change
- bc648c4: The API has fully changed - it is now easier and cleaner than ever to configure a parser and support for subcommands has been added!
- 498b64c: Include the README in the published package
- 258ab05: Increase minimum node version to 18 and upgrade dependencies
-
fa70f34: Arguments can now also separated by an equal sign instead of a whitespace. The following two are equivalent:
parse(["--username=john"]); parse(["--username", "john"]);
- 7f65716: Drop support for parsing object literals: Having to support two very different APIs is exhausting. With a focus on CLI parsing, this lib can move faster.
- 5d14491: Custom long flags can now be specified analogously to custom short flags.
- ae1c933: All user configuration is now validated internally to make sure there are no conflicting values.
- 5d14491: Flags from the
help()
printer command are now ordered alphabetically.
-
10ef97f: New API:
parseSync
is the synchronous alternative toparse
:const { parseSync } = createParser({ greeting: "" }); const parsed = parseSync(["--greeting", "hello"]); parsed; // { greeting: "hello" }
Please check the changelog on GitHub