JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 284
  • Score
    100M100P100Q97256F
  • License MIT

Cross-runtime abstractions for Stambha — Node.js, Bun, and Deno

Package Exports

  • @stambha/runtime

Readme

@stambha/runtime

Cross-runtime utilities — shared abstractions for Node.js, Bun, and Deno (env, paths, fs, timers, crypto).

Part of the @stambha monorepo · GitHub

Used internally by @stambha/core and @stambha/loader. You rarely need to install it directly unless building Stambha-compatible tooling on Bun or Deno.


Install

npm install @stambha/runtime

Requires Node.js 20+ (Bun/Deno supported via conditional exports).


Quick start

import { env, join, readDir, sleep } from "@stambha/runtime";

const token = env("DISCORD_TOKEN");
const src = join(process.cwd(), "src", "commands");

for await (const entry of readDir(src)) {
  console.log(entry.name);
}

await sleep(100);

Key exports

Export Purpose
env, cwd Environment and working directory
join, resolve, basename, extname, pathToFileURL Path helpers
readDir Async directory listing
sleep, delay, cancelDelay Timers
randomUUID UUID generation
detectRuntime "node" | "bun" | "deno"

Package Role
@stambha/core Primary consumer
@stambha/loader File-system piece loading

Development

pnpm --filter @stambha/runtime build
pnpm --filter @stambha/runtime test
pnpm --filter @stambha/runtime smoke