https://github.com/im-beast/compat
One code to run 'em all
https://github.com/im-beast/compat
Last synced: 5 months ago
JSON representation
One code to run 'em all
- Host: GitHub
- URL: https://github.com/im-beast/compat
- Owner: Im-Beast
- License: mit
- Created: 2024-02-19T20:02:51.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-28T14:21:07.000Z (over 1 year ago)
- Last Synced: 2025-08-19T05:57:14.789Z (5 months ago)
- Language: TypeScript
- Homepage:
- Size: 61.5 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ⛰️ 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
```ts
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.