{"id":15832294,"url":"https://github.com/mimamch/cmd","last_synced_at":"2025-02-28T01:17:16.722Z","repository":{"id":180180072,"uuid":"657052315","full_name":"mimamch/cmd","owner":"mimamch","description":"Powerful and Lightweight Command Processing Library for Interactive Applications","archived":false,"fork":false,"pushed_at":"2023-08-30T13:05:48.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-18T16:34:54.692Z","etag":null,"topics":["command-based-interaction","command-dispatching","command-driven-application","command-event-handling","command-execution","command-handler","command-parsing","command-processor"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mimamch.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-22T08:01:00.000Z","updated_at":"2023-07-20T05:20:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"64d94547-586d-40de-96cd-4bdf88260591","html_url":"https://github.com/mimamch/cmd","commit_stats":null,"previous_names":["mimamch/cmd"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mimamch%2Fcmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mimamch%2Fcmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mimamch%2Fcmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mimamch%2Fcmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mimamch","download_url":"https://codeload.github.com/mimamch/cmd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241084007,"owners_count":19907037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-based-interaction","command-dispatching","command-driven-application","command-event-handling","command-execution","command-handler","command-parsing","command-processor"],"created_at":"2024-10-05T12:41:37.568Z","updated_at":"2025-02-28T01:17:16.697Z","avatar_url":"https://github.com/mimamch.png","language":"TypeScript","readme":"# @mimamch/cmd - Powerful and Lightweight Command Processing Library for Interactive Applications\n\n`@mimamch/cmd` is a library for processing and handling commands in text-based applications. This library provides an efficient way to manage and execute commands provided by users.\n\n## Key Features\n\n- **Command Processing**: The library allows you to process commands provided by users easily and efficiently.\n- **Command Handling**: You can define handlers for each command that will be executed when the command is called.\n- **Defined Arguments and Types**: The library supports the definition of command arguments and corresponding data types for each command, ensuring clarity and validity of the received arguments.\n- **Flexible Execution**: You can execute commands by providing arguments that match the command definition, ensuring accurate command execution.\n- **Defined Return Messages**: Each command can produce a return value according to the specified data type, allowing you to provide appropriate responses to users.\n\n## Installation\n\nYou can install `@mimamch/cmd` using npm, the package manager for Node.js. Run the following command:\n\n```\nnpm install @mimamch/cmd\n```\n\n## Usage\n\nTo use `@mimamch/cmd`, follow these steps:\n\n1. Define your custom commands and their corresponding handlers.\n2. Create an instance of the `CommandProcessor` class and pass your commands to it.\n3. Use the `parseCommand` method to execute commands with the specified arguments.\n\nHere's an example of how to use `@mimamch/cmd`:\n\n```javascript\nconst { CommandProcessor } = require(\"@mimamch/cmd\");\n\n// For JS module import\n// import CommandProcessor from \"@mimamch/cmd\";\n\n// Define custom commands and their handlers\nconst commands = {\n  \"/sayhello\": function (name) {\n    return `Hello ${name} welcome to the club 🥳`;\n  },\n};\n\n// Create a CommandProcessor instance with the defined commands\nconst commandProcessor = new CommandProcessor(commands);\n\n// Execute the \"/sayhello\" command with the argument \"mimamch\"\nconst sayHelloResult = commandProcessor.parse(\"/sayhello\", \"mimamch\");\nconsole.log(sayHelloResult);\n```\n\nFor more examples and usage scenarios, you can refer to the [`examples`](examples/javascript) file in the examples directory.\n\n## Documentation\n\nFor detailed documentation, including guides and API references, please visit the [official documentation](https://github.com/mimamch/cmd).\n\n## Contributing\n\nContributions are welcome! Please follow the guidelines outlined in the [CONTRIBUTING.md](https://github.com/mimamch/cmd/blob/main/CONTRIBUTING.md) file.\n\n## License\n\nThis library is licensed under the [MIT License](https://github.com/mimamch/cmd/blob/main/LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmimamch%2Fcmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmimamch%2Fcmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmimamch%2Fcmd/lists"}