{"id":28204558,"url":"https://github.com/moo-w/runtector","last_synced_at":"2025-06-14T06:30:33.640Z","repository":{"id":285548354,"uuid":"958342810","full_name":"moo-w/runtector","owner":"moo-w","description":"JavaScript runtime detector","archived":false,"fork":false,"pushed_at":"2025-04-01T10:27:13.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-17T06:11:25.720Z","etag":null,"topics":["bun","deno","ecmascript","javascipt","js-runtime","nodejs","runtime","runtime-detection"],"latest_commit_sha":null,"homepage":"","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/moo-w.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"publiccode":null,"codemeta":null}},"created_at":"2025-04-01T03:28:09.000Z","updated_at":"2025-04-02T09:39:42.000Z","dependencies_parsed_at":"2025-04-01T11:40:37.128Z","dependency_job_id":null,"html_url":"https://github.com/moo-w/runtector","commit_stats":null,"previous_names":["moo-w/runtector"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/moo-w/runtector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moo-w%2Fruntector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moo-w%2Fruntector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moo-w%2Fruntector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moo-w%2Fruntector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moo-w","download_url":"https://codeload.github.com/moo-w/runtector/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moo-w%2Fruntector/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259773848,"owners_count":22909159,"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","ecmascript","javascipt","js-runtime","nodejs","runtime","runtime-detection"],"created_at":"2025-05-17T06:11:58.372Z","updated_at":"2025-06-14T06:30:33.634Z","avatar_url":"https://github.com/moo-w.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# runtector\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![bundle][bundle-src]][bundle-href]\n[![JSDocs][jsdocs-src]][jsdocs-href]\n[![License][license-src]][license-href]\n\nJavaScript runtime detector\n\n## Installation\n\n```bash\nnpm install runtector\n```\n\n## Usage\n\n```javascript\nimport {\n  getCurRuntime,\n  isBrowser,\n  isBun,\n  isDeno,\n  isHappyDOM,\n  isJSDOM,\n  isNode,\n  isWebWorker,\n} from 'runtector'\n```\n\n## API\n\n- ### `isBrowser()`\n\n    `true` if the current environment is a browser. If the environment is `jsdom` or `happy-dom` it will return `false`.\n\n- ### `isNode()`\n\n    `true` if the current environment is Node.js.\n\n- ### `isWebWorker()`\n\n    `true` if the current environment is a Web Worker.\n\n- ### `isDeno()`\n\n    `true` if the current environment is Deno.\n\n- ### `isBun()`\n\n    `true` if the current environment is Bun.\n\n- ### `isJSDOM()`\n\n    `true` if the current environment is JSDOM.\n\n- ### `isHappyDOM()`\n\n    `true` if the current environment is HappyDOM.\n\n- ### `getCurRuntime()`\n\n    Example:\n\n    ```javascript\n    // Node.js environment\n\n    import { getCurRuntime } from 'runtector'\n\n    console.log(getCurRuntime())\n    /**\n     * ===\u003e\n     * {\n     *    isBrowser: false,\n     *    isNode: true,\n     *    isWebWorker: false,\n     *    isDeno: false,\n     *    isBun: false,\n     *    isJSDOM: false,\n     *    isHappyDOM: false\n     *  }\n     */\n    ```\n\n## License\n\n[MIT](./LICENSE) License © [MOOZON WEI](https://github.com/moo-w)\n\n\u003c!-- Badges --\u003e\n\n[npm-version-src]: https://img.shields.io/npm/v/runtector?style=flat\u0026colorA=080f12\u0026colorB=1fa669\n[npm-version-href]: https://npmjs.com/package/runtector\n[npm-downloads-src]: https://img.shields.io/npm/dm/runtector?style=flat\u0026colorA=080f12\u0026colorB=1fa669\n[npm-downloads-href]: https://npmjs.com/package/runtector\n[bundle-src]: https://img.shields.io/bundlephobia/minzip/runtector?style=flat\u0026colorA=080f12\u0026colorB=1fa669\u0026label=minzip\n[bundle-href]: https://bundlephobia.com/result?p=runtector\n[license-src]: https://img.shields.io/github/license/moo-w/runtector.svg?style=flat\u0026colorA=080f12\u0026colorB=1fa669\n[license-href]: https://github.com/moo-w/runtector/blob/main/LICENSE\n[jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-080f12?style=flat\u0026colorA=080f12\u0026colorB=1fa669\n[jsdocs-href]: https://www.jsdocs.io/package/runtector\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoo-w%2Fruntector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoo-w%2Fruntector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoo-w%2Fruntector/lists"}