{"id":16636134,"url":"https://github.com/minilibs/env-parser","last_synced_at":"2025-09-05T00:42:55.505Z","repository":{"id":248583409,"uuid":"829152863","full_name":"minilibs/env-parser","owner":"minilibs","description":"A lightweight .env parser 🛠️","archived":false,"fork":false,"pushed_at":"2024-07-16T01:15:08.000Z","size":14,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"Production","last_synced_at":"2025-02-02T06:51:10.517Z","etag":null,"topics":["env","env-parser","parser","variable","variable-parser","variables"],"latest_commit_sha":null,"homepage":"https://minilibs.com/packages/env-parser","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/minilibs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-07-15T21:40:36.000Z","updated_at":"2025-01-04T10:02:49.000Z","dependencies_parsed_at":"2024-07-15T23:22:37.684Z","dependency_job_id":"9a3bd26e-b635-4cce-aee6-e7c346d7f42d","html_url":"https://github.com/minilibs/env-parser","commit_stats":null,"previous_names":["bfzli/env-parser","minilibs/env-parser"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minilibs%2Fenv-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minilibs%2Fenv-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minilibs%2Fenv-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minilibs%2Fenv-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minilibs","download_url":"https://codeload.github.com/minilibs/env-parser/tar.gz/refs/heads/Production","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238941559,"owners_count":19556006,"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":["env","env-parser","parser","variable","variable-parser","variables"],"created_at":"2024-10-12T06:05:54.674Z","updated_at":"2025-07-04T06:36:14.991Z","avatar_url":"https://github.com/minilibs.png","language":"TypeScript","readme":"# **Env Parser 🛠️**\n\nParse your variables into objects easily, or use it to build something greater with them. Below is a simple explanation of how to use it. It runs smoothly on both the client and the server without conflicts.\n\nWhen you provide `envPath` (the path to your .env file) as a prop, the function is called on the server side. Alternatively, if you provide `envContent` (a copy-paste of your env files), it runs on either the client or the backend, depending on your environment.\n\n\u003cbr /\u003e\n\n## **How To Env Parser**\n\n### **Importing the Env Parser**\n\n```ts\nimport EnvParser from '@minilibs/env-parser'\n\n// or\n\nimport { EnvParser } from '@minilibs/env-parser'\n```\n\n### **Using The Import**\n\n```ts\n// If you want to run it on the server side, provide envPath. For client-side usage, provide envContent, as files cannot be read directly from the client.\n\nconst { success, error variables } = await EnvParser({\n    envContent: '...',\n    envPath: '.env'\n})\n\n\nif (success) {\n    // Prints the parsed variables; may be empty if none are found.\n    console.log({ variables })\n}\n\nelse {\n    // If an error occurs, it will provide details to help diagnose the issue.\n    console.error({ error })\n}\n\n```\n\n### Fixing a Known Issue with Next.js\n\nIf you are running Next.js on the server and encountering a 'module not found' error after you installed `@minilibs/env-parser`, you can resolve this by adding the following code to your `next.config.js` file:\n\n```js\nconst nextConfig = {\n    webpack: (config, { isServer }) =\u003e {\n        if (!isServer) {\n            config.resolve.fallback = {\n                fs: false,\n                net: false,\n                tls: false,\n                request: false,\n                readline: false,\n                stream: false,\n            }\n        }\n\n        return config\n    }\n}\n\nmodule.exports = nextConfig\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminilibs%2Fenv-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminilibs%2Fenv-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminilibs%2Fenv-parser/lists"}