{"id":14155924,"url":"https://github.com/idleberg/esbuild-plugin-valibot-env","last_synced_at":"2025-04-27T10:04:35.271Z","repository":{"id":242121147,"uuid":"808739332","full_name":"idleberg/esbuild-plugin-valibot-env","owner":"idleberg","description":"Esbuild plugin to validate environment variables against a Valibot schema","archived":false,"fork":false,"pushed_at":"2025-03-31T19:04:08.000Z","size":264,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-27T10:04:17.888Z","etag":null,"topics":["environment-variables","esbuild-plugin","valibot","validation"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/esbuild-plugin-valibot-env","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/idleberg.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,"publiccode":null,"codemeta":null}},"created_at":"2024-05-31T17:57:34.000Z","updated_at":"2025-03-31T19:04:12.000Z","dependencies_parsed_at":"2024-06-26T06:48:26.071Z","dependency_job_id":"7cf74812-4338-49e8-938f-48d8fadd2b7c","html_url":"https://github.com/idleberg/esbuild-plugin-valibot-env","commit_stats":null,"previous_names":["idleberg/esbuild-plugin-valibot-env"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idleberg%2Fesbuild-plugin-valibot-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idleberg%2Fesbuild-plugin-valibot-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idleberg%2Fesbuild-plugin-valibot-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idleberg%2Fesbuild-plugin-valibot-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idleberg","download_url":"https://codeload.github.com/idleberg/esbuild-plugin-valibot-env/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251119619,"owners_count":21539196,"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":["environment-variables","esbuild-plugin","valibot","validation"],"created_at":"2024-08-17T08:05:05.791Z","updated_at":"2025-04-27T10:04:35.249Z","avatar_url":"https://github.com/idleberg.png","language":"TypeScript","funding_links":[],"categories":["others"],"sub_categories":[],"readme":"# esbuild-plugin-valibot-env\n\n\u003e Esbuild plugin to validate environment variables against a Valibot schema.\n\n[![License](https://img.shields.io/github/license/idleberg/esbuild-plugin-valibot-env?color=blue\u0026style=for-the-badge)](https://github.com/idleberg/esbuild-plugin-valibot-env/blob/main/LICENSE)\n[![Version: npm](https://img.shields.io/npm/v/esbuild-plugin-valibot-env?style=for-the-badge)](https://www.npmjs.org/package/esbuild-plugin-valibot-env)\n[![Version: jsr](https://img.shields.io/jsr/v/@idleberg/esbuild-plugin-valibot-env?style=for-the-badge)](https://jsr.io/@idleberg/esbuild-plugin-valibot-env)\n[![CI: Node](https://img.shields.io/github/actions/workflow/status/idleberg/esbuild-plugin-valibot-env/node.yml?logo=nodedotjs\u0026logoColor=white\u0026style=for-the-badge)](https://github.com/idleberg/esbuild-plugin-valibot-env/actions)\n[![CI: Deno](https://img.shields.io/github/actions/workflow/status/idleberg/esbuild-plugin-valibot-env/deno.yml?logo=deno\u0026logoColor=white\u0026style=for-the-badge)](https://github.com/idleberg/esbuild-plugin-valibot-env/actions)\n\n## Why?\n\nIt's generally a good idea to check that you're all set up early in the development process. Validating that your environment variables have been defined and are of the expected type is a part of that – for yourself and your colleagues. While there are _many_ libraries to validate against a schema, [Valibot](https://valibot.dev/) stands out for its versatility and modularity. The small footprint makes it an ideal candidate for validation in the frontend. So why not use it in your development process as well?\n\n## Installation\n\n`npm install -D esbuild-plugin-valibot-env valibot`\n\n## Usage\n\nLet's start with a very basic example\n\n```ts\nimport { build } from 'esbuild';\nimport * as v from 'valibot';\nimport valibot from 'esbuild-plugin-valibot-env';\n\nconst envSchema = v.object({\n\tESBUILD_API_ENDPOINT: v.pipe(v.string(), v.url()),\n\tESBUILD_LOCALE: v.literal('en_US'),\n});\n\nawait build({\n\tentryPoints: ['demo.ts'],\n\tplugins: [\n\t\tvalibot(schema),\n\t],\n});\n```\n\n### API\n\n`valibot(schema, options?)`\n\n### Options\n\n#### `options.envFile`\n\nType: `String`  \nDefault: `\".env\"`  \n\nSpecify a path to an `.env` file. It will be passed to the `dotenv` package.\n\n#### `options.language`\n\nType: `string`  \nDefault: `undefined`  \n\nLanguage ID for localized error messages.\n\n#### `options.transformValues`\n\nType: `Boolean`  \nDefault: `false`  \n\nSetting this to `true` will try and transform string values to their respective types. Supports booleans, integers, floats, and `null`.\n\n## Related\n\n- [vite-plugin-valibot-env](https://github.com/idleberg/vite-plugin-valibot-env)\n\n## License\n\nThis work is licensed under [The MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidleberg%2Fesbuild-plugin-valibot-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidleberg%2Fesbuild-plugin-valibot-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidleberg%2Fesbuild-plugin-valibot-env/lists"}