Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@teamteanpm2024/eius-rem-eveniet
Advanced tools
> Type-safe CLI library with no runtime dependencies
Type-safe CLI library with no runtime dependencies
yarn 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:
class SuccessCommand extends Command {
async execute() {
return 0;
}
}
Commands can also be exposed via one or many arbitrary paths using the paths
static property:
class FooCommand extends Command {
static paths = [[`foo`]];
async execute() {
this.context.stdout.write(`Foo\n`);
}
}
class BarCommand extends Command {
static paths = [[`bar`]];
async execute() {
this.context.stdout.write(`Bar\n`);
}
}
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:
class HelloCommand extends Command {
// Positional option
name = Option.String();
async execute() {
this.context.stdout.write(`Hello ${this.name}!\n`);
}
}
Option arguments can be validated and coerced using the Typanion library:
class AddCommand extends Command {
a = Option.String({required: true, validator: t.isNumber()});
b = Option.String({required: true, validator: t.isNumber()});
async execute() {
this.context.stdout.write(`${this.a + this.b}\n`);
}
}
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.
FAQs
> Type-safe CLI library with no runtime dependencies
We found that @teamteanpm2024/eius-rem-eveniet demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.