{"versions":{"1.0.0":{"name":"@webcontainer/env","description":"Set of environment utilities for WebContainers","version":"1.0.0","author":{"name":"StackBlitz Inc."},"license":"MIT","types":"dist/index.d.ts","main":"dist/index.js","scripts":{"build":"esbuild src/index.ts --bundle --minify --keep-names --platform=node --external:@blitz/env --outfile=dist/index.js && tsc --project tsconfig.build.json --emitDeclarationOnly","test":"jest","prepack":"npm run test && npm run build"},"exports":{"require":"./dist/index.js","import":"./dist/index.js"},"devDependencies":{"esbuild":"^0.14.38"},"keywords":["stackblitz","webcontainer","nodejs"],"bugs":{"url":"https://github.com/stackblitz/webcontainer-core/issues"},"homepage":"https://github.com/stackblitz/webcontainer-core","repository":{"type":"git","url":"git+https://github.com/stackblitz/webcontainer-core.git"},"gitHead":"baa4b6fb08d1d5ac53b3eeaf3266d6d7f5c6caf9","_id":"@webcontainer/env@1.0.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-DF9G5spcuFF4qApkNpeiLabAK5skJtC2E80NJuJsyYtdG/aKrcM46eiR+lRGRHybtQDigfXOWXZdrbwJzP7xlQ==","shasum":"26cbf67f4824d875b66b73345b603694ae795248","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@webcontainer/env/-/env-1.0.0.tgz","fileCount":7,"unpackedSize":9662,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFj5ryuS6Cp24YhXwqLwJo8KzpcYlmK5ANYyIEX6d5vwAiAyUymWAbCz44STkbd+fGBqFJJxJCgJquzOY9gPlAz9NQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiemntACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrfBQ/+P5cTNzNSqBVbH8qksU1JL+i+zbQjUvL0QXJ+JA/eOyR9ZsFW\r\ne8dgm0Qb5CQTwIyYjSh+cRLwpJyKgUVoVGMyS8MpIe9fGuVsfLrRRiQhdt9Z\r\nyfHbpv7jukVJz7mGeuukDhBSjiCReOLfnMuT/05mJN4DromBGAMAT5AeEVgt\r\nCvq9USkemB3NOg+9uXAnZY9DfweRvAc1s2P0wCP0F3bw9VkVVJtqejsqJPC9\r\nktJygT5dFCAIdhtsFlRSpEIW9iPvQqM7iey1LX26K+F8exsBjo/HqgjimV4R\r\nshgJAwSOX6MLO13Jvm1BxR3cAbf9+ddvBfNau4g6D7E+nJyjSY7Pl/acdxzq\r\nQsIzgW7wSuKq8s0LC2Qm5J+q9WPzSNwM13pBNZgrFDa19mOxl6b4hQwQlsOx\r\nLmleETG7KzvNX7ByuQVqrlZBpGVgEkk3Pu2xwxnEwD0/3x+0M6X1G3d97BUE\r\nHhT137Soxa4zpqzz66x6ZARvX2spwxMEEcXeFetuEy9YSwhUgYPUpUc/lqYw\r\nQ4czdXuknmYCXdfqlnHNJbxWOGB/UlfvMxhyjWh/Dip6tD6Ekhj7g4ckT2g2\r\ny748MzIgQ18TD9ZqDGxoMtx4/3e516vCj+6KGtF+drEanaW/Le+7ghvsmHHl\r\nCAWw06CboCyIKtwN3hcMhUq7mB6zEGWC16U=\r\n=B/3E\r\n-----END PGP SIGNATURE-----\r\n","size":4049},"_npmUser":{"name":"anonymous","email":"elmdominic@gmx.net"},"directories":{},"maintainers":[{"name":"anonymous","email":"elmdominic@gmx.net"},{"name":"anonymous","email":"iamalbertpai@gmail.com"},{"name":"anonymous","email":"eric@esft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/env_1.0.0_1652189677199_0.001292945205255469"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-05-10T15:19:19.018Z","contributors":[]},"1.0.1":{"name":"@webcontainer/env","description":"Set of environment utilities for WebContainers","version":"1.0.1","author":{"name":"StackBlitz Inc."},"license":"MIT","types":"dist/index.d.ts","main":"dist/index.js","scripts":{"build":"esbuild src/index.ts --bundle --minify --keep-names --platform=node --external:@blitz/env --outfile=dist/index.js && tsc --project tsconfig.build.json --emitDeclarationOnly","test":"jest","prepack":"npm run test && npm run build"},"exports":{"require":"./dist/index.js","import":"./dist/index.js"},"devDependencies":{"esbuild":"^0.14.38"},"keywords":["stackblitz","webcontainer","nodejs"],"bugs":{"url":"https://github.com/stackblitz/webcontainer-core/issues"},"homepage":"https://github.com/stackblitz/webcontainer-core","repository":{"type":"git","url":"git+https://github.com/stackblitz/webcontainer-core.git"},"gitHead":"1becece65fb9e6d89d27bbe87eedd4d64b37a3a4","_id":"@webcontainer/env@1.0.1","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-q5sD2asa7IY/elCA37zbzTH1DiiIooTuUcW9O5Zvrtfyy7PtqAmPpgpDCbWzA/fRWShfUnPp6yDzmpq5K4YtjA==","shasum":"9cf6798078db61c7c36d6f325aec26a7236f68a6","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@webcontainer/env/-/env-1.0.1.tgz","fileCount":7,"unpackedSize":9660,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC4n/+P/TA88bHuGavOBixgjIIMgNBoAauHHZx5jb5J4AiA1BTv3q8X9hru1XUbujzcwIeutM22VkMyquJm5C14izw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiemsBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqzGRAApKLPlsTpXgb/UJbFE271kt4N1V0P8ainu3qJUupTtggvkO7i\r\nD67ZdTTQgImYT0lHEBuumvToxSNHhPqJyzKGHKEhZ2iLXF3vp78Shd8ktv0F\r\nW7OZ8WnE8rXk2aEbrRRH+d9d4WYPoYgJL8pjA1SsCXWPlCBQ1eotMeuqM+PD\r\nT2LkpIayIgN5JHB3NdM7fVvizSVfC/C959j5TGXv7EioU3imEvgkp/IKevuy\r\ngbcEBJnObQc3AT7m+uZHy1wj9fdN2WSUU4w4pOsPmVtfsVb902uLlw01DXf2\r\nqTagWz1PLinrRqt4WdMZSWYPm2QFMkJU6DsOQzYiSCqj+9YggjDc74xcNFL+\r\nQyrvpBD6PByN1w0v/dcuy7aDJBGBZ+0vEa8Sas+1GK9xvzsGLzoFXI4KMiMx\r\nRSduPRK2NODJ0O+4u8iB2y1IV8f5/G2aJdE3PFhLzrA+618UoBbUK40hT4oQ\r\n+yi0QKAuonByt/MochkhLmgUCsbqq5nKLnFVLd0c7xwLYP8XIi77/iskg3KX\r\nRNQkU7ylHKQI8zZXkKlzBivHvf+V2DMcvUru8PfSXAwQ5v1FFNVZ6MbFF4N1\r\n5akeGr7ovXhVIwRkWfHnnw4c48brrYKI8vdhyx5L4AVpTjP8XrbBoqZgjLcA\r\npCCLUyWVrgyuZyRQ+6KwKBA/NYXNRH2fZgM=\r\n=VVyL\r\n-----END PGP SIGNATURE-----\r\n","size":4046},"_npmUser":{"name":"anonymous","email":"elmdominic@gmx.net"},"directories":{},"maintainers":[{"name":"anonymous","email":"elmdominic@gmx.net"},{"name":"anonymous","email":"iamalbertpai@gmail.com"},{"name":"anonymous","email":"eric@esft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/env_1.0.1_1652189953244_0.35090178759948065"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-05-10T15:19:20.032Z","contributors":[]},"1.1.0":{"name":"@webcontainer/env","description":"Set of environment utilities for WebContainers","version":"1.1.0","author":{"name":"StackBlitz Inc."},"license":"MIT","types":"dist/index.d.ts","main":"dist/index.js","scripts":{"build":"esbuild src/index.ts --bundle --minify --keep-names --platform=node --external:@blitz/internal/env --outfile=dist/index.js && tsc --project tsconfig.build.json --emitDeclarationOnly","test":"jest","prepack":"npm run test && npm run build"},"exports":{"require":"./dist/index.js","import":"./dist/index.js"},"devDependencies":{"esbuild":"^0.14.38"},"keywords":["stackblitz","webcontainer","nodejs"],"bugs":{"url":"https://github.com/stackblitz/webcontainer-core/issues"},"homepage":"https://github.com/stackblitz/webcontainer-core","repository":{"type":"git","url":"git+https://github.com/stackblitz/webcontainer-core.git"},"gitHead":"8f264d9ee3217b269379ef30cd3177ea09036952","_id":"@webcontainer/env@1.1.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-DreJFHUui8vq1N3nQGU3HwK5UI4hVNW7VQfhAOmeQbBVnpKtGhoNobjDNF8LzlN7ssmFI9Uhkc9Au4mtKvPK6Q==","shasum":"807cb96a46cabe84d2ca8b43beaecbedbc22271f","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@webcontainer/env/-/env-1.1.0.tgz","fileCount":7,"unpackedSize":9919,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDU2fMuEb3Q3YxJHxH7L7PDPzUXdJb/7LrmkjgEQ2D51gIhAPUXCyc2Lo9W6RYsYRidiHIAVqH+HhN1zvdmDpcWwe+k"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkHWGdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpd/w/8CN32lEKBEg2HAm3lp4tv4aH/r8qdgFH6rWaHHXriIzAyACyc\r\nl0mJEprkH0jKhhSN9aa7QmV13VytJqYv5KqKIN5zM8UM0YiarkxEJy003TMy\r\nTEELObCkFCN77lZqSN34TcIwtuFBBHx3I3aB0lLeo/8x9gKki3vH7hfPCTf8\r\ncqvR+I51+sPfzB6J4IwOY8siUF4SaCFsR8v9T9gMWb5JfpTpv/AiDk2m91JY\r\nIufgcHhWOe9nM3XxylxRu1xYftRmxYfn0FS49QfBXzGUuLLo0PJD/UHgWQY6\r\n/2ylkNsO8dUaeyCZdtqt+au4+5xngwJ76qn7/I9QXiegxLyTR74l2WJgJDZP\r\nXJHrwRGNKqOdvfmnA0ZaFGZahf5L7ndPcknG8x3MDgVNX2h1KLRi3oNVQ2ZF\r\noJsJPOseHOHhvGfSB1SLIMlL1UeOoKicdu1UwQdCTvrCZqs2iKrSWwAkH3Q7\r\n844EaegRycX2y6KcHJgSxNSEOf/R5i5e3aY9swiGfKa/IDa3K93/BP9pqDws\r\nNs3JkNjEe1SxavK2gQziVTPeUU2y7+LiQEoXoElZ6qL73nKx1wsExSWhbq4B\r\nENkay9GIqTlwVMgPlSKCLWDq2xowD4i9XDidNyVQP7BErBHip4ctVbTuc5wv\r\ndJv4NW/4RJbtHdQHczymkkrP1NEEVyuUu64=\r\n=hJoU\r\n-----END PGP SIGNATURE-----\r\n","size":4081},"_npmUser":{"name":"anonymous","email":"elmdominic@gmx.net"},"directories":{},"maintainers":[{"name":"anonymous","email":"devops@stackblitz.com"},{"name":"anonymous","email":"roberto.vidal@ikumene.com"},{"name":"anonymous","email":"elmdominic@gmx.net"},{"name":"anonymous","email":"iamalbertpai@gmail.com"},{"name":"anonymous","email":"eric@esft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/env_1.1.0_1679647132993_0.3483045032523062"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-03-24T08:38:53.147Z","publish_time":1679647133147,"contributors":[]},"1.1.1":{"name":"@webcontainer/env","description":"Set of environment utilities for WebContainers","version":"1.1.1","author":{"name":"StackBlitz Inc."},"license":"MIT","types":"dist/index.d.ts","main":"dist/index.js","scripts":{"build":"ts-node -T scripts/build.ts && tsc --project tsconfig.build.json --emitDeclarationOnly","test":"jest","prepack":"npm run test && npm run build"},"exports":{"require":"./dist/index.js","import":"./dist/index.js"},"devDependencies":{"esbuild":"^0.19.5"},"keywords":["stackblitz","webcontainer","nodejs"],"bugs":{"url":"https://github.com/stackblitz/webcontainer-core/issues"},"homepage":"https://github.com/stackblitz/webcontainer-core","repository":{"type":"git","url":"git+https://github.com/stackblitz/webcontainer-core.git"},"_id":"@webcontainer/env@1.1.1","gitHead":"d37f1e4ad427c6f1fbdaea8463f30dd1d4fa5555","_nodeVersion":"18.18.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-6aN99yL695Hi9SuIk1oC88l9o0gmxL1nGWWQ/kNy81HigJ0FoaoTXpytCj6ItzgyCEwA9kF1wixsTuv5cjsgng==","shasum":"23021b2bb24befeeef53dba8996d1886b7016515","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@webcontainer/env/-/env-1.1.1.tgz","fileCount":7,"unpackedSize":9982,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDanMRybej94VJMDjr0/cyNqVKAZPPMg8NOTJM79TeIRgIhAOnfzDSatNhR0OI23GTbXxcZ1ec32aqKDYcdsJUti5Zs"}],"size":4079},"_npmUser":{"name":"anonymous","email":"elmdominic@gmx.net"},"directories":{},"maintainers":[{"name":"anonymous","email":"nemikolh@gmail.com"},{"name":"anonymous","email":"devops@stackblitz.com"},{"name":"anonymous","email":"roberto.vidal@ikumene.com"},{"name":"anonymous","email":"elmdominic@gmx.net"},{"name":"anonymous","email":"iamalbertpai@gmail.com"},{"name":"anonymous","email":"eric@esft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/env_1.1.1_1711615025771_0.7964961964544757"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-03-28T08:37:05.934Z","publish_time":1711615025934,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"1.1.1"},"name":"@webcontainer/env","time":{"created":"2022-05-10T15:19:23.911Z","modified":"2026-03-20T15:18:43.584Z","1.0.0":"2022-05-10T13:34:37.325Z","1.0.1":"2022-05-10T13:39:13.409Z","1.1.0":"2023-03-24T08:38:53.147Z","1.1.1":"2024-03-28T08:37:05.934Z"},"readme":"# @webcontainer/env\n\n> ⚠️ Important ⚠️\n>\n> We strongly recommend that you update to version `1.1.0` or greater as we\n> recently introduced a breaking change in WebContainer, making older versions of\n> `@webcontainer/api` generate invalid `HostURL.href` and `HostURL.hostname`\n> when those methods are called inside a WebContainer.\n\nSet of environment utilities for [WebContainers](https://blog.stackblitz.com/posts/introducing-webcontainers/).\n\n## Install\n\n```shell\n$ npm install @webcontainer/env\n```\n\n## API\n\n### `isWebContainer(): boolean` (method)\n\nReturns a `boolean` indicating whether the program runs in a WebContainer.\n\n### `HostURL` (class)\n\nThe `HostURL` class represents a host specific URL. It can be used to parse a regular URL, such as\n`http://localhost:1234`, into a `HostURL`. Only if the program is executed in a WebContainer,\nthe `hostname` is resolved to a WebContainer hostname, e.g. `http://blitz--1234.local.webcontainer.io`.\nThis can be useful to create platform-dependent OAuth callback URLs.\n\n#### [`HostURL.port(): string`](https://developer.mozilla.org/en-US/docs/Web/API/URL/port) (getter)\n\n#### [`HostURL.hash(): string`](https://developer.mozilla.org/en-US/docs/Web/API/URL/hash) (getter)\n\n#### [`HostURL.host(): string`](https://developer.mozilla.org/en-US/docs/Web/API/URL/host) (getter)\n\n#### [`HostURL.hostname(): string`](https://developer.mozilla.org/en-US/docs/Web/API/URL/hostname) (getter)\n\n#### [`HostURL.href(): string`](https://developer.mozilla.org/en-US/docs/Web/API/URL/href) (getter)\n\n#### [`HostURL.origin(): string`](https://developer.mozilla.org/en-US/docs/Web/API/URL/origin) (getter)\n\n#### [`HostURL.username(): string`](https://developer.mozilla.org/en-US/docs/Web/API/URL/username) (getter)\n\n#### [`HostURL.password(): string`](https://developer.mozilla.org/en-US/docs/Web/API/URL/password) (getter)\n\n#### [`HostURL.pathname(): string`](https://developer.mozilla.org/en-US/docs/Web/API/URL/pathname) (getter)\n\n#### [`HostURL.protocol(): string`](https://developer.mozilla.org/en-US/docs/Web/API/URL/protocol) (getter)\n\n#### [`HostURL.search(): string`](https://developer.mozilla.org/en-US/docs/Web/API/URL/search) (getter)\n\n#### [`HostURL.searchParams(): URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URL/searchParams) (getter)\n\n#### `HostURL.parse(url: string | URL): HostURL` (static method)\n\nParses a `url` into a `HostURL`. On local this is a no-op but when running in a WebContainer it resolves `localhost`\nto a WebContainer hostname.\n\n**Example**\n\n```js\nimport { HostURL, isWebContainer } from '@webcontainer/env';\n\nconst hostURL = HostURL.parse('http://localhost:1234');\n\n/**\n * Note that this branching would not be necessary as the host URL gets parsed\n * and resolved automatically through `HostURL.parse()` (see above). So `href`\n * will return a different value depending on the environment. This is illustrated\n * with the following `if` statement.\n */\nif (isWebContainer()) {\n  console.log(hostURL.href); // http://blitz--1234.local.webcontainer.io\n} else {\n  console.log(hostURL.href); // http://localhost:1234\n}\n```\n\n#### `HostURL.update(change: Partial<UpdateableURLProperties>): HostURL` (method)\n\nUpdates the `HostURL`.\n\n##### **change**\n\nObject containing the URL changes. Note that some properties are immutable (read-only), e.g. `origin` or `searchParams`. When updating the `port` it automatically updates the `host`.\n\nType: `Partial<UpdateableURLProperties>`\n\n```js\ninterface UpdateableURLProperties {\n  hash: string;\n  host: string;\n  hostname: string;\n  href: string;\n  password: string;\n  pathname: string;\n  port: string;\n  protocol: string;\n  search: string;\n  username: string;\n}\n```\n\n#### `HostURL.toString(): string` (method)\n\nStringifies the HostURL. It is effectively a read-only version of `HostURL.href`.\n\n#### `HostURL.toJSON(): string` (method)\n\nReturns a string containing a serialized version of the `HostURL`.","users":{}}