{"id":21522160,"url":"https://github.com/hugoalh-studio/cross-env-es","last_synced_at":"2025-07-16T07:30:57.184Z","repository":{"id":228132813,"uuid":"773255110","full_name":"hugoalh-studio/cross-env-es","owner":"hugoalh-studio","description":"An ES (JavaScript \u0026 TypeScript) module for cross runtime environment variables interface.","archived":false,"fork":false,"pushed_at":"2024-05-23T03:33:01.000Z","size":91,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-23T09:29:51.612Z","etag":null,"topics":["cross","env","environment-variables","es","javascript","js","modulejs","ts","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hugoalh-studio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-17T06:45:11.000Z","updated_at":"2024-05-23T03:33:04.000Z","dependencies_parsed_at":"2024-05-09T11:26:42.707Z","dependency_job_id":"d64e1549-270e-40b5-a433-dc4bbdd609db","html_url":"https://github.com/hugoalh-studio/cross-env-es","commit_stats":null,"previous_names":["hugoalh-studio/cross-env-ts","hugoalh-studio/cross-env-es"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugoalh-studio%2Fcross-env-es","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugoalh-studio%2Fcross-env-es/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugoalh-studio%2Fcross-env-es/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugoalh-studio%2Fcross-env-es/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hugoalh-studio","download_url":"https://codeload.github.com/hugoalh-studio/cross-env-es/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226112989,"owners_count":17575438,"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":["cross","env","environment-variables","es","javascript","js","modulejs","ts","typescript"],"created_at":"2024-11-24T01:09:28.772Z","updated_at":"2024-11-24T01:09:29.507Z","avatar_url":"https://github.com/hugoalh-studio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cross Env (ES)\n\n[**⚖️** MIT](./LICENSE.md)\n\n[![GitHub: hugoalh-studio/cross-env-es](https://img.shields.io/github/v/release/hugoalh-studio/cross-env-es?label=hugoalh-studio/cross-env-es\u0026labelColor=181717\u0026logo=github\u0026logoColor=ffffff\u0026sort=semver\u0026style=flat \"GitHub: hugoalh-studio/cross-env-es\")](https://github.com/hugoalh-studio/cross-env-es)\n[![JSR: @hugoalh/cross-env](https://img.shields.io/jsr/v/@hugoalh/cross-env?label=@hugoalh/cross-env\u0026labelColor=F7DF1E\u0026logo=jsr\u0026logoColor=000000\u0026style=flat \"JSR: @hugoalh/cross-env\")](https://jsr.io/@hugoalh/cross-env)\n[![NPM: @hugoalh/cross-env](https://img.shields.io/npm/v/@hugoalh/cross-env?label=@hugoalh/cross-env\u0026labelColor=CB3837\u0026logo=npm\u0026logoColor=ffffff\u0026style=flat \"NPM: @hugoalh/cross-env\")](https://www.npmjs.com/package/@hugoalh/cross-env)\n\nAn ES (JavaScript \u0026 TypeScript) module for cross runtime environment variables interface.\n\n## 🔰 Begin\n\n### 🎯 Targets\n\n|  | **Registry - JSR** | **Registry - NPM** | **Remote Import** |\n|:--|:--|:--|:--|\n| **[Bun](https://bun.sh/)** \u003e= v1.1.0 | [✔️ `node_modules`](https://jsr.io/docs/npm-compatibility) | [✔️ Specifier `npm:`](https://bun.sh/docs/runtime/autoimport) | ❌ |\n| **[Deno](https://deno.land/)** \u003e= v1.42.0 | [✔️ Specifier `jsr:`](https://jsr.io/docs/with/deno) | [✔️ Specifier `npm:`](https://docs.deno.com/runtime/manual/node/npm_specifiers) | [✔️](https://docs.deno.com/runtime/manual/basics/modules/#remote-import) |\n| **[NodeJS](https://nodejs.org/)** \u003e= v16.13.0 | [✔️ `node_modules`](https://jsr.io/docs/with/node) | [✔️ `node_modules`](https://docs.npmjs.com/using-npm-packages-in-your-projects) | ❌ |\n\n\u003e **ℹ️ Note**\n\u003e\n\u003e It is possible to use this module in other methods/ways which not listed in here, however it is not officially supported.\n\n### #️⃣ Registries Identifier\n\n- **JSR:**\n  ```\n  @hugoalh/cross-env\n  ```\n- **NPM:**\n  ```\n  @hugoalh/cross-env\n  ```\n\n\u003e **ℹ️ Note**\n\u003e\n\u003e - Although it is recommended to import the entire module, it is also able to import part of the module with sub path if available, please visit [file `jsr.jsonc`](./jsr.jsonc) property `exports` for available sub paths.\n\u003e - It is recommended to use this module with tag for immutability.\n\n### #️⃣ Remote Import Paths\n\n- **GitHub Raw:** (Require Tag)\n  ```\n  https://raw.githubusercontent.com/hugoalh-studio/cross-env-es/${Tag}/mod.ts\n  ```\n\n\u003e **ℹ️ Note**\n\u003e\n\u003e - Although it is recommended to import the entire module with the main path `mod.ts`, it is also able to import part of the module with sub path if available, but do not import if:\n\u003e\n\u003e   - it's file path has an underscore prefix (e.g.: `_foo.ts`, `_util/bar.ts`), or\n\u003e   - it is a benchmark or test file (e.g.: `foo.bench.ts`, `foo.test.ts`), or\n\u003e   - it's symbol has an underscore prefix (e.g.: `export function _baz() {}`).\n\u003e\n\u003e   These elements are not considered part of the public API, thus no stability is guaranteed for them.\n\u003e - Although there have 3rd party services which provide enhanced, equal, or similar methods/ways to remote import the module, beware these services maybe inject unrelated elements and thus affect the security.\n\n### 🛡️ Permissions\n\n| **Target** | **Type** | **Coverage** |\n|:--|:--|:--|\n| Deno | Environment Variable (`allow-env`) | All |\n\n## 🧩 APIs\n\n- ```ts\n  const env: CrossEnv;\n  ```\n- ```ts\n  const envPath: CrossEnvPath;\n  ```\n- ```ts\n  const envPathExt: CrossEnvPathExt;\n  ```\n- ```ts\n  function isEnvironmentCI(): boolean;\n  ```\n- ```ts\n  function isEnvironmentDocker(): Promise\u003cboolean\u003e;\n  ```\n- ```ts\n  function isEnvironmentHeroku(): boolean;\n  ```\n- ```ts\n  function isEnvironmentHyper(): boolean;\n  ```\n- ```ts\n  function isEnvironmentPodman(): Promise\u003cboolean\u003e;\n  ```\n- ```ts\n  function isEnvironmentRoot(): boolean;\n  ```\n- ```ts\n  function isEnvironmentSSH(): boolean;\n  ```\n- ```ts\n  function isEnvironmentTravis(): boolean;\n  ```\n- ```ts\n  function isEnvironmentWSL(): Promise\u003cboolean\u003e;\n  ```\n- ```ts\n  interface CrossEnv {\n    delete(key: string): void;\n    get(key: string): string | undefined;\n    getAll(): { [key: string]: string; };\n    has(key: string): boolean;\n    set(key: string, value: string): void;\n  }\n  ```\n- ```ts\n  interface CrossEnvPath {\n    add(...values: string[]): void;\n    delete(...values: string[]): void;\n    get(): string[];\n  }\n  ```\n- ```ts\n  interface CrossEnvPathExt {\n    add(...values: string[]): void;\n    delete(...values: string[]): void;\n    get(): string[] | null;\n  }\n  ```\n\n\u003e **ℹ️ Note**\n\u003e\n\u003e For the prettier documentation, can visit via:\n\u003e\n\u003e - [Deno CLI `deno doc`](https://deno.land/manual/tools/documentation_generator)\n\u003e - [JSR](https://jsr.io/@hugoalh/cross-env)\n\n## ✍️ Examples\n\n- ```ts\n  env.delete(\"SOME_VAR\");\n  ```\n- ```ts\n  env.get(\"HOME\");\n  //=\u003e \"/home/alice\"\n  ```\n- ```ts\n  env.get(\"SOME_VAR\");\n  //=\u003e undefined\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugoalh-studio%2Fcross-env-es","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhugoalh-studio%2Fcross-env-es","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugoalh-studio%2Fcross-env-es/lists"}