Skip to content
Sign upLog in
Profile icon

Elias Val

@EliasVal
Repls
Community
EliasVal
EliasVal
shared a Post
2 years ago
Node v14? (Current LTS)
Hello! I have some features that was included in node 14 in order for my project to work, how can I update my repl from node 12 to 14?
RYANTADIPARTHI
RYANTADIPARTHI
i'm not sure if you can do that. Repl.it has a default version of node.js. So you can't upgrade.2 years ago
EliasVal
EliasVal
shared a Post
2 years ago
Hello! I am trying to make a variable that can be available to all files in the /cmds/ dir without having to mass the variable in the function (See li
Coder100
Coder100
That's because it takes some time to load all the global variables (like on line 116) 2 years ago
realTronsi
realTronsi
Just export the variable through module.exports = variable_name and require it in the other files const variablename = require("./whateverfile") You only need to export from where the variable was declared, and all other files in the cmd directory can just require it2 years ago
EliasVal
EliasVal
shared a Post
2 years ago
Hello! I need some variables to be available in all js files in a node.js app. when I'm using the global property (global.myVar = val) and then try to
Coder100
Coder100
Make sure you run both scripts lol2 years ago
EliasVal
EliasVal
shared a Post
2 years ago
Hello! I'm trying to store the admin Firebase credentials that need to be hidden. The credentials come as a JSON file. Any idea how I can store it whi
Coder100
Coder100
I accomplished it in JS, python should be similar, idk about any other languages. Ok, let's start! Create a .env file (exactly that), and inside put: JSONKEY={...} and just paste in the JSON file (make sure to first do JSON.stringify() to the file so you can remove the newlines) Then, to access the JSON: JSON.parse(process.env.JSONKEY) GL!2 years ago
PattanAhmed
PattanAhmed
@EliasVal Hi, Yes, You can hide all your credentials in a file called .ENV. It will be safe there. Here is a short note:- .env files are used for declaring environment variables. On Repl.it, .env files are only visible to the owner of the repl. Other users and guests viewing a public repl will not be able to see the contents of the .env file, nor will they be able to access it by downloading the repl or forking it. The only exception to this is Multiplayer - other users in your Multiplayer sessi2 years ago
CodeLongAndPros
CodeLongAndPros
Use an ENV file https://docs.repl.it/repls/secret-keys2 years ago
EliasVal
EliasVal
shared a Post
2 years ago
Hi! I am trying to use the admin Firebase node package and I need to use the credentials to get access to my db... I am trying to store the json objec
Coder100
Coder100
Why the repost? I accomplished it in JS, python should be similar, idk about any other languages. Ok, let's start! Create a .env file (exactly that), and inside put: JSONKEY={...} and just paste in the JSON file (make sure to first do JSON.stringify() to the file so you can remove the newlines) Then, to access the JSON: JSON.parse(process.env.JSONKEY) Good Luck!2 years ago
PattanAhmed
PattanAhmed
@EliasVal Hi, Yes, You can hide all your credentials in a file called .ENV. It will be safe there. Here is a short note:- .env files are used for declaring environment variables. On Repl.it, .env files are only visible to the owner of the repl. Other users and guests viewing a public repl will not be able to see the contents of the .env file, nor will they be able to access it by downloading the repl or forking it. The only exception to this is Multiplayer - other users in your Multiplayer sessi2 years ago