I have this code:
const bot = new Telegraf('tokengoeshereblablablabla')
And I want it to look like this:
const bot = new Telegraf(TOKEN)
So my Telegram token wont be leaked. I know it's possible, but I don't find it eather here in StackOverflow either Google.
Thanks in advance.
In repl.it you can set your secret variables in specific section
Look at this image below you can set key as TOKEN and value [YOURTOKEN]

Simply you can use it in nodejs file like:
const bot = new Telegraf(process.env.TOKEN)
Note: if you can't access it like above line, you will need to install dotenv package to load environment variables.