{"id":26871330,"url":"https://github.com/codeadamca/nodejs-dotenv","last_synced_at":"2025-10-04T13:33:08.283Z","repository":{"id":270707559,"uuid":"911220579","full_name":"codeadamca/nodejs-dotenv","owner":"codeadamca","description":"Using the dotenv package to load environment variables. ","archived":false,"fork":false,"pushed_at":"2025-01-26T21:16:53.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T22:20:52.066Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/codeadamca.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":"2025-01-02T14:13:10.000Z","updated_at":"2025-01-26T21:16:56.000Z","dependencies_parsed_at":"2025-01-02T15:36:00.911Z","dependency_job_id":null,"html_url":"https://github.com/codeadamca/nodejs-dotenv","commit_stats":null,"previous_names":["codeadamca/nodejs-dotenv"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fnodejs-dotenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fnodejs-dotenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fnodejs-dotenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fnodejs-dotenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeadamca","download_url":"https://codeload.github.com/codeadamca/nodejs-dotenv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246429486,"owners_count":20775809,"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":[],"created_at":"2025-03-31T07:19:08.234Z","updated_at":"2025-10-04T13:33:08.168Z","avatar_url":"https://github.com/codeadamca.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hiding Node.js Environment Varaibles\n\nUsing the4 `dotenv` Nopde.js package to load variables from an .env file.\n\n1. Create a file called `.env` and place it in your project folder.\n\n2. Put your actual database credentials and API keys in your `.env``file:\n    \n    ```php\n    DB_HOST=\u003cDB_HOST\u003e\n    DB_DATABASE=\u003cDB_DATABASE\u003e\n    DB_USERNAME=\u003cDB_USERNAME\u003e\n    DB_PASSWORD=\u003cDB_PASSWORD\u003e\n    \n    API_SECRET=real_api_key\n    ```\n\n3. Create a second copy of your `.env` file and name it `.env.sample`. Use this file to provide instructions to the next programmer using your project code:\n    \n    ```php\n    DB_HOST=localhost\n    DB_DATABASE=database\n    DB_USERNAME=username\n    DB_PASSWORD=password\n    \n    API_SECRET=api_key\n    ```\n\n4. Make sure your GitHub repo does not include the file named `.env`. In your `.gitignore` file add:\n    \n    ```\n    .env\n    ```\n\n\u003e [!Note]\n\u003e I have excluded this step in this repo so you can view both the `.env` and `.env.sample` files. \n\n5. Add `dotenv` to your project:\n\n    ```\n    npm add dotenv\n    npm i\n    ```\n\n6. Start the Node.js app:\n\n    ```\n    node app.js\n    ```\n\n---\n\n## Project Stack\n\nThis project uses [Node.js](https://nodejs.org/).\n\n\u003cimg src=\"https://console.codeadam.ca/api/image/nodejs\" width=\"60\"\u003e \n\n---\n\n## Repo Resources\n\n- [Node.js](https://nodejs.org/)\n- [dotenv](https://www.npmjs.com/package/dotenv)\n\n\u003cbr\u003e\n\u003ca href=\"https://codeadam.ca\"\u003e\n\u003cimg src=\"https://cdn.codeadam.ca/images@1.0.0/codeadam-logo-coloured-horizontal.png\" width=\"200\"\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeadamca%2Fnodejs-dotenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeadamca%2Fnodejs-dotenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeadamca%2Fnodejs-dotenv/lists"}