I'm trying to preload dotenv variables directly through a npm script and it's not working. According to dotenv docs they mention:
You can use the --require (-r) command line option to preload dotenv. By doing this, you do not need to require and load dotenv in your application code. This is the preferred approach when using import instead of require.
$ node -r dotenv/config your_script.js
my package.json has the following scripts:
"start": "nodemon --watch src --ext js,ts --exec ts-node src --require dotenv/config src",
Could someone help me with this issue?