
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@forgehive/runner
Advanced tools
A task runner library for managing and executing tasks with proper type safety and error handling.
A task runner library for managing and executing tasks with proper type safety and error handling.
npm install @forgehive/runner
The @forgehive/runner
package provides a way to manage and execute tasks with:
Here's a simple example of using the runner:
import { Runner } from '@forgehive/runner';
import { Task, Schema } from '@forgehive/task';
// Create a runner
const runner = new Runner();
// Create a task
const task = new Task(({ name }: { name: string }) => {
return `Hello, ${name}!`;
});
// Load the task
runner.load('greet', task);
// Run the task
const result = await runner.run('greet', { name: 'John' });
console.log(result); // "Hello, John!"
You can provide custom argument parsing:
interface CustomArgs {
task: string;
args: {
name: string;
age: number;
};
}
const runner = new Runner<CustomArgs>((data) => ({
taskName: data.task,
args: data.args
}));
// Now the runner expects data in this format
await runner.run('greet', { name: 'John', age: 30 });
You can inspect task details:
const runner = new Runner();
const task = new Task(({ name }: { name: string }) => {
return `Hello, ${name}!`;
});
task.setDescription('A greeting task');
runner.load('greet', task);
// Get task details
const details = runner.describe();
console.log(details);
// {
// greet: {
// name: 'greet',
// description: 'A greeting task',
// schema: { ... }
// }
// }
Runner
Classconstructor(parseArgumentsFn?)
: Creates a new runner with optional custom argument parsingload(name: string, task: TaskInstanceType)
: Loads a task with the given namerun(name: string, args: unknown)
: Runs a task with the given argumentsgetTask(name: string)
: Gets a task by namegetTasks()
: Gets all loaded tasksgetTaskList()
: Gets list of task namesdescribe()
: Returns details about all loaded taskssetHandler(handlerFn)
: Sets a custom handler for task executionRunnerParsedArguments
: Base interface for parsed argumentsTaskRecord
: Record type for task dataMIT
FAQs
A task runner library for managing and executing tasks with proper type safety and error handling.
The npm package @forgehive/runner receives a total of 101 weekly downloads. As such, @forgehive/runner popularity was classified as not popular.
We found that @forgehive/runner 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.