colipar
v1.0.1
Published
Simplifies capturing and parsing user input from the command line.
Downloads
4
Readme
Colipar
Colipar is a lightweight and flexible tool for capturing and parsing user input from the command line.
Features
- Lightweight: Colipar is lightweight and has a small footprint, making it easy to integrate into your project.
- Flexible: Colipar allows you to capture and parse user input from the command line in a flexible and customizable way.
- TypeScript Support: Colipar is written in TypeScript, making it easy to use with TypeScript projects.
Installation
npm install colipar
pnpm add colipar
yarn add colipar
bun add colipar
Usage
const input = colipar({
flags: {
msg: { type: "string", short: "m" },
version: { type: "boolean", short: "v" }
}
})
// Your code here
my-command --msg "Hello world" # output: { msg: "Hello world", version: false }
my-command -m "Hello world" # output: { msg: "Hello world", version: false }
my-command -v # output: { msg: undefined, version: true }
my-command # output: { msg: undefined, version: false }
API Reference
colipar(options)
Captures and parses user input from the command line.
options
(object): The options for capturing and parsing user input.flags
(object): The flags to capture and parse.[key]
(string): The name of the flag.type
(string): The type of the flag. Can be either"string"
or"boolean"
.short
(string): The short version of the flag.
Example:
const input = colipar({
flags: {
msg: { type: "string", short: "m" },
version: { type: "boolean", short: "v" }
}
})
Contributing
Contributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request. Here are some ways you can contribute:
- Bug Reports: If you find any bugs or unexpected behavior, please open an issue describing the problem.
- Feature Requests: If you have ideas for new features or improvements, feel free to suggest them by opening an issue.
- Code Contributions: Contributions to the codebase via pull requests are highly appreciated. Before submitting a pull request, please make sure to follow the contribution guidelines below.
Contribution Guidelines
- Fork the repository and clone it to your local machine.
- Create a new branch for your feature/fix:
git checkout -b feature-name
. - Make changes and test them thoroughly.
- Ensure that your code follows the existing code style and conventions.
- Update the README and documentation if necessary.
- Commit your changes with descriptive commit messages.
- Push your branch to your fork:
git push origin feature-name
. - Open a pull request to the
main
branch of the original repository.
Thank you for contributing to colipar!
License
This project is licensed under the MIT License - see the LICENSE file for details.