Skip to main content
Home

latest
It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
52%
Published
5 months ago (1.0.0)

Takopack Runtime

This module provides a lightweight runtime for executing unpacked .takopack archives. It exposes a TakoPack class which loads extension code and attaches a takos API instance to globalThis so that extension scripts can access the Takos APIs.

import { TakoPack } from "@takopack/runtime";

const runtime = new TakoPack([
  { manifest, server },
], {
  fetch: customFetch,
  kv: { read: myRead },
  events: {
    publish: myPublish,
    publishToClient: myPublishClient,
  },
});
await runtime.init();
const result = await runtime.callServer(manifest.identifier, "hello", [
  "world",
]);

The assets.write API accepts an optional { cacheTTL } option following the specification in docs/takopack/main.md.

The implementation is intentionally minimal and focuses on server-side execution. The takos object exposes stub implementations of the APIs described in docs/takopack/main.md.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@takopack/runtime

Import symbol

import * as runtime from "@takopack/runtime";
or

Import directly with a jsr specifier

import * as runtime from "jsr:@takopack/runtime";

Add Package

pnpm i jsr:@takopack/runtime
or (using pnpm 10.8 or older)
pnpm dlx jsr add @takopack/runtime

Import symbol

import * as runtime from "@takopack/runtime";

Add Package

yarn add jsr:@takopack/runtime
or (using Yarn 4.8 or older)
yarn dlx jsr add @takopack/runtime

Import symbol

import * as runtime from "@takopack/runtime";

Add Package

vlt install jsr:@takopack/runtime

Import symbol

import * as runtime from "@takopack/runtime";

Add Package

npx jsr add @takopack/runtime

Import symbol

import * as runtime from "@takopack/runtime";

Add Package

bunx jsr add @takopack/runtime

Import symbol

import * as runtime from "@takopack/runtime";