Compatibility
@ppabari/strio relies on the Web Crypto API (crypto.getRandomValues), which is available natively across all modern JavaScript runtimes.
Support matrix
| Environment | Supported | Notes |
|---|---|---|
| Node.js | โ โฅ 18 | Web Crypto is global from Node 18 onward. |
| Browsers | โ modern | Chrome, Edge, Firefox, Safari. |
| Deno | โ | Web Crypto is built in. |
| Bun | โ | Web Crypto is built in. |
| Cloudflare Workers | โ | And other workerd / edge runtimes. |
| TypeScript | โ โฅ 5.0 | Ships complete .d.ts declarations. |
| zod (optional) | โ โฅ 3.0 | Only needed for the @ppabari/strio/zod subpath. |
Runtime check
The package exposes a programmatic check so applications can fail fast on an unsupported runtime instead of erroring at first use.
import { checkCompatibility, assertCompatible } from '@ppabari/strio';
// Inspect without throwing
const report = checkCompatibility();
// {
// ok: true,
// cryptoAvailable: true,
// runtime: 'node',
// nodeVersion: '20.11.0',
// warnings: []
// }
// Or fail fast at startup
assertCompatible(); // throws a descriptive Error on an unsupported runtime
From the CLI:
npx @ppabari/strio --check
# Runtime : node (Node 20.11.0)
# Web Crypto : available
# Compatible : yes
See the Compatibility API for the full reference.