https://github.com/media-service-dev/console
A library to create console applications
https://github.com/media-service-dev/console
console library nodejs typescript
Last synced: 4 months ago
JSON representation
A library to create console applications
- Host: GitHub
- URL: https://github.com/media-service-dev/console
- Owner: media-service-dev
- License: mit
- Created: 2020-03-19T15:45:44.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-12-16T12:34:57.000Z (over 4 years ago)
- Last Synced: 2025-10-04T23:48:47.077Z (9 months ago)
- Topics: console, library, nodejs, typescript
- Language: TypeScript
- Homepage:
- Size: 780 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @mscs/console
This is a library to write console applications in typescript for node.
## Installation
```shell script
$ yarn add @mscs/console
```
## Usage
Short example:
```typescript
import { Application, ArgumentMode } from "@mscs/console";
const application = new Application("Demo", "0.1.0-DEV");
application.register("commandName")
.setDescription("command description")
.addArgument("argumentName", ArgumentMode.REQUIRED, "argument description")
.setCode(async (input, output) => {
output.writeln("Demo - 0.1.0-DEV");
output.writeln("Argument: " + input.getArgument("argumentName"));
return 0;
});
async function runtime() {
await application.run();
}
runtime()
.catch(error => {
console.log(error);
process.exit(1);
});
```
# Important note
Since *Symfony* is, for good reason, a registered trademark, please take note that we are in no way associated with [the Symfony brand](https://symfony.com/) or the [SensioLabs](https://sensiolabs.com/) organization.
Therefore, we don't represent or speak for any of them.
## Difference between symfony/console
First of all not all features are included.
Currently, you won't have:
- The Kernel
- The Container
- CommandLoader
- Auto-Complete
- Progressbar (planned)
- MultiByte support
- Alternative commands suggestions (planned)
There also might be changes between the API.