{"id":18763579,"url":"https://github.com/iguntur/prop-env","last_synced_at":"2026-05-08T13:11:39.178Z","repository":{"id":65475896,"uuid":"81846562","full_name":"iguntur/prop-env","owner":"iguntur","description":"Getter and Setter 'process.env' variable from '.env' file","archived":false,"fork":false,"pushed_at":"2017-02-13T16:52:31.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T06:37:45.177Z","etag":null,"topics":["env","library","node","npm","process","utility"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/iguntur.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":"2017-02-13T16:35:26.000Z","updated_at":"2017-04-23T10:30:43.000Z","dependencies_parsed_at":"2023-01-25T06:15:16.466Z","dependency_job_id":null,"html_url":"https://github.com/iguntur/prop-env","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iguntur%2Fprop-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iguntur%2Fprop-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iguntur%2Fprop-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iguntur%2Fprop-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iguntur","download_url":"https://codeload.github.com/iguntur/prop-env/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239389483,"owners_count":19630310,"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","library","node","npm","process","utility"],"created_at":"2024-11-07T18:26:40.052Z","updated_at":"2025-12-06T04:30:15.706Z","avatar_url":"https://github.com/iguntur.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# prop-env [![Build Status](https://travis-ci.org/iguntur/prop-env.svg?branch=master)](https://travis-ci.org/iguntur/prop-env)\n\n\u003e Getter and Setter 'process.env' variable from '.env' file\n\n\n## Install\n\n```\n$ npm install --save prop-env\n```\n\n\n## Usage\n\n```\n├── .env\n├── index.js\n└── package.json\n```\n\n```\n// '.env' file\nTWITTER_CONSUMER_KEY=gNiRPbQNG\nTWITTER_CONSUMER_SECRET=95tpBUhR\n```\n\n```js\nconst env = require('prop-env');\n\nconsole.log(env('TWITTER_CONSUMER_KEY'));\n//=\u003e 'gNiRPbQNG'\n\nconsole.log(env('TWITTER_CONSUMER_SECRET'));\n//=\u003e '95tpBUhR'\n\n// set default value\nconsole.log(env('TWITTER_TOKEN_KEY'));\n//=\u003e undefined\n\nconsole.log(env('TWITTER_TOKEN_KEY', 'Umst0AZIiwex36'))\n//=\u003e 'Umst0AZIiwex36'\n\nconsole.log(env('TWITTER_TOKEN_KEY'));\n//=\u003e 'Umst0AZIiwex36'\n\nconsole.log(env('TWITTER_TOKEN_SECRET'));\n//=\u003e undefined\n\nconsole.log(env('TWITTER_TOKEN_SECRET', 'LxU9qi9hAe'));\n//=\u003e 'LxU9qi9hAe'\n\n// Can not override the value\nconsole.log(env('TWITTER_TOKEN_SECRET', 'fooBar'));\n//=\u003e 'LxU9qi9hAe'\n\nconsole.log(env('TWITTER_TOKEN_SECRET'));\n//=\u003e 'LxU9qi9hAe'\n\nconsole.log(process.env);\n/*\n{\n    // ...\n    \"TWITTER_CONSUMER_KEY\": \"gNiRPbQNG\",\n    \"TWITTER_CONSUMER_SECRET\": \"95tpBUhR\",\n    \"TWITTER_TOKEN_KEY\": \"Umst0AZIiwex36\",\n    \"TWITTER_TOKEN_SECRET\": \"LxU9qi9hAe\",\n    // ...\n}\n*/\n```\n\n\n## API\n\n### env(key, value, envFile)\n\nReturns `string` value of process.env `key`\n\n\n#### key\n\nType: `string`\n\nprocess.env key\n\n#### value\n\nSet env value\n\n#### envFile\n\nType: `string`\u003cbr\u003e\nDefault: `process.cwd() + '/.env'`\n\nSet env path\n\n\n## License\n\nMIT © [Guntur Poetra](http://iguntur.starmediateknik.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figuntur%2Fprop-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figuntur%2Fprop-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figuntur%2Fprop-env/lists"}