Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
gnomejs/rt-taskThe core tasks primitives for rt that enables creating custom tasks.
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




JSR Score
100%
Published
a year ago (0.0.0)
@rt/task

Overview
The core tasks primitives for rt that enables creating custom tasks.
Basic Usage
import { TaskBase, TaskResult, registerTask, type Task, type TaskExecutionContext } from str from '@rt/task' export class SimpleTask extends TaskBase { run: (ctx: TaskExecutionContext) => Promise<void> } registerTask({ id: "simple-task", match: function(task: Task) { return task instanceof SimpleTask }, handler: async (ctx) => { const task = ctx.task as SimpleTask const result = new TaskResult(task); result.start(); try { await task.run(ctx); return result.end(); } catch(e) { return result.end('error', {}, e); } } });
Built and signed on
GitHub Actions
Add Package
deno add jsr:@rt/task
Import symbol
import * as task from "@rt/task";
Import directly with a jsr specifier
import * as task from "jsr:@rt/task";
Add Package
pnpm i jsr:@rt/task
pnpm dlx jsr add @rt/task
Import symbol
import * as task from "@rt/task";
Add Package
yarn add jsr:@rt/task
yarn dlx jsr add @rt/task
Import symbol
import * as task from "@rt/task";
Add Package
vlt install jsr:@rt/task
Import symbol
import * as task from "@rt/task";
Add Package
npx jsr add @rt/task
Import symbol
import * as task from "@rt/task";
Add Package
bunx jsr add @rt/task
Import symbol
import * as task from "@rt/task";