Gathering detailed insights and metrics for @teamteanpm2024/eius-rem-eveniet
Gathering detailed insights and metrics for @teamteanpm2024/eius-rem-eveniet
npm install @teamteanpm2024/eius-rem-eveniet
Typescript
Module System
Node Version
NPM Version
59.8
Supply Chain
96.2
Quality
80.3
Maintenance
100
Vulnerability
100
License
Cumulative downloads
Total Downloads
Last day
0%
0
Compared to previous day
Last week
0%
0
Compared to previous week
Last month
0%
0
Compared to previous month
Last year
0%
0
Compared to previous year
37
Type-safe CLI library with no runtime dependencies
1yarn add @teamteanpm2024/eius-rem-eveniet
yarn workspaces list
)--
(for example yarn dlx eslint --fix
)Clipanion is used in Yarn with great success.
Check the website for our documentation: mael.dev/@teamteanpm2024/eius-rem-eveniet.
You can use @teamteanpm2024/eius-rem-eveniet-v3-codemod
to migrate a Clipanion v2 codebase to v3.
Commands are declared by extending from the Command
abstract base class, and more specifically by implementing its execute
method which will then be called by Clipanion. Whatever exit code it returns will then be set as the exit code for the process:
1class SuccessCommand extends Command { 2 async execute() { 3 return 0; 4 } 5}
Commands can also be exposed via one or many arbitrary paths using the paths
static property:
1class FooCommand extends Command { 2 static paths = [[`foo`]]; 3 async execute() { 4 this.context.stdout.write(`Foo\n`); 5 } 6} 7 8class BarCommand extends Command { 9 static paths = [[`bar`]]; 10 async execute() { 11 this.context.stdout.write(`Bar\n`); 12 } 13}
Options are defined as regular class properties, annotated by the helpers provided in the Option
namespace. If you use TypeScript, all property types will then be properly inferred with no extra work required:
1class HelloCommand extends Command { 2 // Positional option 3 name = Option.String(); 4 5 async execute() { 6 this.context.stdout.write(`Hello ${this.name}!\n`); 7 } 8}
Option arguments can be validated and coerced using the Typanion library:
1class AddCommand extends Command { 2 a = Option.String({required: true, validator: t.isNumber()}); 3 b = Option.String({required: true, validator: t.isNumber()}); 4 5 async execute() { 6 this.context.stdout.write(`${this.a + this.b}\n`); 7 } 8}
Copyright © 2019 Mael Nison
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
No vulnerabilities found.
No security vulnerabilities found.