Corev0.1.8
@tekir/runtime
Cross-runtime abstraction layer. File ops, SQLite, server, hashing. Works on Bun and Node.js.
Installation
$
bun add @tekir/runtimeFeatures
- Runtime detection: isBun(), isNode(), runtimeName()
- File operations: read, write, stat, exists, fileResponse
- SQLite via openDatabase() on both Bun and Node.js
- Password hashing: bcrypt and argon2 across runtimes
- Cross-runtime serve() and spawn()
Quick Example
TypeScript
import { isBun, readFileText, openDatabase } from '@tekir/runtime'
console.log('Running on Bun:', isBun())
const content = await readFileText('config.json')
const db = openDatabase('app.db')Changelog
v0.1.8LatestSeptember 16, 2026
- Runtime adapters now provide portable Node fallbacks for server, filesystem, password, process, garbage-collection, and SQLite operations.
- Published output now uses the shared Node-targeted ESM bundle pipeline with external dependencies and generated TypeScript declarations, while Bun consumers keep the native source export.
v0.1.7August 22, 2026
- The Node.js HTTP fallback now returns an awaitable shutdown promise, stops accepting new connections before cleanup and waits for active requests to finish. Forced shutdown also closes active Node.js connections immediately, matching the Bun server contract.
v0.1.6July 23, 2026
- Package metadata now follows the shared compatible
0.1.xdependency range used by this coordinated Tekir release.
v0.1.5July 16, 2026
- The Node HTTP adapter streams response bodies instead of buffering them and preserves multiple
Set-Cookieheaders correctly across runtime boundaries.
v0.1.4June 13, 2026
- The Node server now streams response bodies chunk by chunk (with backpressure and client-disconnect aborts) instead of buffering the whole body into memory first.
serve()gainedmaxRequestBodySize(default 10 MB) andidleTimeout(default 120 s) on both runtimes. On Node, oversize requests are rejected with a413during accumulation, and request/header timeouts are set.fileResponse()accepts an optionalbaseDirand rejects../escapes; MIME types are now detected consistently on both runtimes.openDatabase()skips WAL on read-only opens.readFile/readFileTextnow produce a consistent error carryingcode: 'ENOENT'and thepathon both runtimes. Runtime detection now verifiesprocess.versions.nodeand throws a clear error when neither Bun nor Node is detected.- Found and fixed with Fable.
v0.1.3May 3, 2026
readDir(path)andreadDirRecursive(path, options)list directory contents across runtimes. The recursive walker usesBun.Globon Bun and falls back to a depth-firstnode:fs/promiseswalk on Node. Skipsnode_modules,.git, and dotfiles by default; passextensionsto filter by suffix andignoreto widen the skip list.
v0.1.2May 2, 2026
- Header conversion no longer requires the
DOM.Iterablelib in the consumer's tsconfig. Replaced theHeaders.entries()call in the Node.js server adapter withHeaders.forEach, which is part of plainDOM.
v0.1.1April 27, 2026
openDatabase()now creates missing parent directories automatically. A path like'./database/app.sqlite'works on a fresh project even when nodatabase/folder exists yet.
v0.1.0April 1, 2026
- Initial release