Skip to main content
Home

latest

Package that tries to make writing cross-runtime code easier.

This package works with Node.js, Deno, BrowsersIt is unknown whether this package works with Cloudflare Workers, Bun
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
This package works with Browsers
JSR Score
100%
Published
10 months ago (0.2.5)

⛰️ Compat

Package that tries to make writing cross-runtime code easier.
Compat exposes a set of modules that wrap around respective runtimes to work on Deno, Node and Browsers with the same API.

Get started

import { command, PermissionDenied, ... } from "@beast/compat";

try {
  await command("echo", ["-e", "\\e[31mHello!\\e[0m"], {
    stdout: "inherit",
  });
} catch (error) {
  if (error instanceof PermissionDenied) {
    console.error("You do not have permission to run this command.");
  } else {
    console.error(error);
  }
}

...

Targeted platforms:

  • 🦕 Deno
  • 🐢 Node
  • 🌐 Browsers

📝 Licensing

This project is available under MIT License conditions.

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:@beast/compat

Import symbol

import * as compat from "@beast/compat";
or

Import directly with a jsr specifier

import * as compat from "jsr:@beast/compat";

Add Package

pnpm i jsr:@beast/compat
or (using pnpm 10.8 or older)
pnpm dlx jsr add @beast/compat

Import symbol

import * as compat from "@beast/compat";

Add Package

yarn add jsr:@beast/compat
or (using Yarn 4.8 or older)
yarn dlx jsr add @beast/compat

Import symbol

import * as compat from "@beast/compat";

Add Package

npx jsr add @beast/compat

Import symbol

import * as compat from "@beast/compat";

Add Package

bunx jsr add @beast/compat

Import symbol

import * as compat from "@beast/compat";