{"id":13801355,"url":"https://github.com/fernandolguevara/deno-envconfig","last_synced_at":"2026-04-22T23:34:36.548Z","repository":{"id":65200951,"uuid":"586563474","full_name":"fernandolguevara/deno-envconfig","owner":"fernandolguevara","description":"golang envconfig syntax for deno","archived":false,"fork":false,"pushed_at":"2023-01-17T23:05:43.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-15T02:49:21.342Z","etag":null,"topics":["deno","env","envconfig","envvars","typescript"],"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/fernandolguevara.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}},"created_at":"2023-01-08T15:29:27.000Z","updated_at":"2023-03-05T00:47:41.000Z","dependencies_parsed_at":"2023-02-10T12:16:51.543Z","dependency_job_id":null,"html_url":"https://github.com/fernandolguevara/deno-envconfig","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/fernandolguevara/deno-envconfig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandolguevara%2Fdeno-envconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandolguevara%2Fdeno-envconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandolguevara%2Fdeno-envconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandolguevara%2Fdeno-envconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fernandolguevara","download_url":"https://codeload.github.com/fernandolguevara/deno-envconfig/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandolguevara%2Fdeno-envconfig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32159959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T17:06:48.269Z","status":"ssl_error","status_checked_at":"2026-04-22T17:06:19.037Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["deno","env","envconfig","envvars","typescript"],"created_at":"2024-08-04T00:01:21.956Z","updated_at":"2026-04-22T23:34:36.533Z","avatar_url":"https://github.com/fernandolguevara.png","language":"TypeScript","funding_links":[],"categories":["Modules"],"sub_categories":["Utils"],"readme":"# envconfig\n\nthis library is based on\n[envconfig](https://github.com/kelseyhightower/envconfig) for gloang\n\n## marks\n\n### types\n\n```md\n- `string\n- `bool\n- `number\n- `date\n```\n\n### val\n\n```md\n- `required\n- `max\n- `min\n```\n\n### modifiers\n\n```\n`env\n```\n\n```ts\nconst env = { MYAPP_PORT: \"3003\" };\nconst envconfig = {\n  port: \"`env:MYAPP_PORT`number`default:3000\",\n} as const;\nconst e = parse(env, envconfig);\nconsole.log(e);\n// output = { port: 3000 }\n```\n\n```\n`prefix\n```\n\n```ts\nconst env = { MYAPP_PORT: \"3003\" };\nconst envconfig = {\n  port: \"`prefix:MYAPP`number`default:3000\",\n} as const;\nconst e = parse(env, envconfig);\nconsole.log(e);\n// output = { port: 3000 }\n```\n\n```\n`prefix\n```\n\n```ts\nconst env = { MYAPP_PORT_AWESOME: \"3003\" };\nconst envconfig = {\n  port: \"`prefix:MYAPP`suffix:AWESOME`number`default:3000\",\n} as const;\nconst e = parse(env, envconfig);\nconsole.log(e);\n// output = { port: 3000 }\n```\n\n```\n`split_words\n```\n\n```ts\nconst env = { MYAPP_PORT_AWESOME: \"3003\" };\nconst envconfig = {\n  myappPortAwesome: \"`split_words`number`default:3000\",\n  // lookup \"myapp_port_awesome\" on env object\n} as const;\nconst e = parse(env, envconfig);\nconsole.log(e);\n// output = { port: 3000 }\n```\n\n```\n`split_values\n```\n\n```ts\nconst env = { LIST: \"1,2,3\" };\nconst envconfig = {\n  list: \"`split_value`number`default:4,5,6\",\n} as const;\nconst e = parse(env, envconfig);\nconsole.log(e);\n// output = { list: [1,2,3] }\n```\n\n```\n`uppercase\n```\n\n```ts\nconst env = { super_key: \"uppercase\" };\nconst envconfig = {\n  super_key: \"`uppercase`string\",\n} as const;\nconst e = parse(env, envconfig);\nconsole.log(e);\n// output = { super_key: \"UPPERCASE\" }\n```\n\n```\n`lowercase\n```\n\n```ts\nconst env = { super_key: \"LOWERCASE\" };\nconst envconfig = {\n  super_key: \"`lowercase`string\",\n} as const;\nconst e = parse(env, envconfig);\nconsole.log(e);\n// output = { super_key: \"lowercase\" }\n```\n\n- `format\n\n### Alises\n\n```\n- `string[] = `string`split_values\n- `bool[] = `bool`split_values\n- `date[] = `date`split_values\n- `number[] = `number`split_values\n```\n\n## Example\n\n```ts\nconst _envconfig = {\n  log: {\n    level: \"`string`default:DEBUG\",\n  },\n  server: {\n    hostname: \"`string`default:0.0.0.0\",\n    port: \"`default:3003`number\",\n  },\n  app: {\n    name: \"`string`default:my-app\",\n    description: \"`string`default:my awesome app\",\n    contact: \"`string`default:~\",\n    version: \"`string`default:~\",\n  },\n  db: {\n    type: \"`string`default:memory\",\n    createSchema: \"`bool`split_words`default:true\",\n    dropSchemaIfExists: \"`bool`split_words`default:true\",\n    shared: {\n      __prefix: \"\",\n      hostname: \"`string\",\n      port: \"`number`default:-1\",\n      user: \"`string\",\n      password: \"`string\",\n      database: \"`string\",\n    },\n    sqlite: {\n      path: \"`string`default::memory:\",\n    },\n    mysql: {\n      connectionLimit: \"`number`split_words`default:4\",\n    },\n    postgres: {\n      applicationName: \"`string`split_words`default:deno-nostr\",\n      connectionsAttemps: \"`number`split_words`default:1\",\n      hostType: \"`string`split_words`default:tcp\",\n      tlsEnforce: \"`bool`split_words`default:false\",\n      maxIndexKeys: \"`string`default:32\",\n    },\n  },\n} as const;\n// using \"as const\" the parse function generates the output structure\n// check the examples/envconfig.ts folder\n\nconst env = Deno.env.toObject();\n\nconst e = parse(env, _envconfig);\n\nconsole.log(e);\n```\n\n```js\n{\n  log: { level: \"DEBUG\" },\n  server: { hostname: \"0.0.0.0\", port: 3003 },\n  app: {\n    name: \"my-app\",\n    description: \"my awesome app\",\n    contact: \"~\",\n    version: \"~\",\n  },\n  db: {\n    type: \"memory\",\n    createSchema: true,\n    dropSchemaIfExists: true,\n    shared: {\n      hostname: undefined,\n      port: -1,\n      user: undefined,\n      password: undefined,\n      database: undefined,\n    },\n    sqlite: { path: \":memory:\" },\n    mysql: { connectionLimit: 4 },\n    postgres: {\n      applicationName: \"my-app\",\n      connectionsAttemps: 1,\n      hostType: \"tcp\",\n      tlsEnforce: false,\n      maxIndexKeys: \"32\",\n    },\n  },\n}\n```\n\n### IntelliSense\n\nparse function generates the output structure when \"as const\" is used on the\nconfiguration object\n\ncheck the [examples/envconfig.ts](/examples/envconfig.ts) folder\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffernandolguevara%2Fdeno-envconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffernandolguevara%2Fdeno-envconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffernandolguevara%2Fdeno-envconfig/lists"}