question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue

Description

Using process.env is not great as the used env variables seem to be not declared anywhere. We should use cross-env for testing purposes and use some config for setting them instead of using process.env.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
charlesjliucommented, Oct 4, 2018

I don’t think we should have a .env committed into the repo.

https://www.npmjs.com/package/dotenv#should-i-commit-my-env-file

Is there a reason why those links are set using environment variables (slack etc.)? I don’t think those should be set by the environment.

If anything, you could set default values if the environment variables aren’t detected. We can have a sample .env file that developers can use to write their own and include instructions in the repo. But environment variables should be for things like… the CODING_COACH_API url, or whatever client API keys we’re using (like the Google Analytics example).

Just my two cents! 🤷‍♂️

0reactions
DanielRufcommented, Oct 4, 2018

Exactly. dot-env are normally meant for credentials and user specific settings.

Read more comments on GitHub >

github_iconTop Results From Across the Web

process.env: What it is and why/when/how to use it effectively
The process.env global variable is injected by the Node at runtime for your application to use and it represents the state of the...
Read more >
process.env. - Node.js
No information is available for this page.
Read more >
Working with Environment Variables in Node.js - Twilio
When your Node.js process boots up, it'll automatically provide access to all existing environment variables by creating an env object ...
Read more >
Node.js process.env Property - GeeksforGeeks
The process.env property is an inbuilt application programming interface of the process module which is used to get the user environment.
Read more >
Node Environment Variables: Process env Node
In Node.js, process.env is a global variable injected during runtime. It is a view of the state of the system environment variables. When...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found