{"id":28655717,"url":"https://github.com/tr1ckydev/runtimey","last_synced_at":"2025-06-13T08:07:45.219Z","repository":{"id":176805605,"uuid":"659221704","full_name":"tr1ckydev/runtimey","owner":"tr1ckydev","description":"Easily detect which JavaScript runtime is being used.","archived":false,"fork":false,"pushed_at":"2024-02-21T18:05:51.000Z","size":5,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-27T14:25:17.849Z","etag":null,"topics":["bun","deno","node","runtime"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/runtimey","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tr1ckydev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-06-27T11:28:53.000Z","updated_at":"2025-05-13T16:45:29.000Z","dependencies_parsed_at":"2023-06-28T12:00:24.858Z","dependency_job_id":null,"html_url":"https://github.com/tr1ckydev/runtimey","commit_stats":null,"previous_names":["tr1ckydev/runtimey"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tr1ckydev/runtimey","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tr1ckydev%2Fruntimey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tr1ckydev%2Fruntimey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tr1ckydev%2Fruntimey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tr1ckydev%2Fruntimey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tr1ckydev","download_url":"https://codeload.github.com/tr1ckydev/runtimey/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tr1ckydev%2Fruntimey/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259606974,"owners_count":22883560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bun","deno","node","runtime"],"created_at":"2025-06-13T08:07:44.512Z","updated_at":"2025-06-13T08:07:45.178Z","avatar_url":"https://github.com/tr1ckydev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# runtimey\nEasily detect which JavaScript runtime is being used. [Bun](https://bun.sh/), [Deno](https://deno.com/runtime), [Node.JS](https://nodejs.org/) or browser.\n\nUseful for packages or scripts to customize functionality of their code depending on the runtime being executed.\n\n\n\n## Usage\n\n*index.js*\n\n```javascript\nimport { currentRuntime } from \"runtimey\";\nconsole.log(currentRuntime);\n```\n\n*shell*\n\n```bash\n$ bun index.js \u0026\u0026 deno run index.js \u0026\u0026 node index.js\nbun\ndeno\nnode\n```\n\n\n\n## Documentation\n\n- ### `isBun`\n\n  `true` if the Bun runtime is being used.\n\n- ### `isDeno`\n\n  `true` if the Deno runtime is being used.\n\n- ### `isNode`\n\n  `true` if the Node.JS runtime is being used.\n\n- ### `isBrowser`\n\n  `true` if running inside a browser.\n\n- ### `currentRuntime`: `\"bun\"` | `\"deno\"` | `\"node\"` | `\"browser\"` | `\"unknown\"`\n\n  The name of the current runtime being used.\n\n- ### `runtimeValue({ bun, deno, node, browser, default })`\n\n  Returns the value according to the runtime being used.\n  \n  *index.js*\n  \n  ```javascript\n  import { runtimeValue } from \"runtimey\";\n  const val = runtimeValue({ bun: \"RUNTIME_BUN\", deno: \"RUNTIME_DENO\", node: \"RUNTIME_NODE\" });\n  console.log(\"Current runtime:\", val);\n  ```\n  \n  *shell*\n  \n  ```bash\n  $ bun index.js \u0026\u0026 deno run index.js \u0026\u0026 node index.js\n  Current runtime: RUNTIME_BUN\n  Current runtime: RUNTIME_DENO\n  Current runtime: RUNTIME_NODE\n  ```\n  \n- ### `isServiceWorker`\n\n  `true` if running in a worker environment.\n\n\n\n## License\n\nThis repository uses MIT License. See [LICENSE](https://github.com/tr1ckydev/runtimey/blob/main/LICENSE) for full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftr1ckydev%2Fruntimey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftr1ckydev%2Fruntimey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftr1ckydev%2Fruntimey/lists"}