@sanity/cli
Version:
Sanity CLI tool for managing Sanity installations, managing plugins, schemas and datasets
13 lines (12 loc) • 361 B
text/typescript
export function detectRuntime() {
if ('Deno' in globalThis) {
return 'deno'
}
if ('Bun' in globalThis) {
return 'bun'
}
// Consider using a more reliable way of detecting that we're actually in Node.js
// I first attempted using https://www.npmjs.com/package/is-really-node, but it fails
// due to using top level await.
return 'node'
}