This repository was archived by the owner on Aug 7, 2023. It is now read-only.
How to read environment variables in a Node project? #481
Unanswered
imdavidmin
asked this question in
Help
Replies: 2 comments 1 reply
-
|
You need to install dotenv module first // npm install dotenv
const dotenv = require('dotenv')
dotenv.config()
// using environment variable SECRET_KEY
const secret_key = process.env.SECRET_KEY |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Please delete this thread - |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In my JS code I would like to read from an environment variable I've set on the deta CLI.
With
import { os } from 'os';,os.getenvis showing as not valid with typescript checking.process.envwasn't working before.Beta Was this translation helpful? Give feedback.
All reactions