Questions tagged [node-config]

Use this tag if you have a question specifically to https://www.npmjs.com/package/config. For other nodejs configuration question, you are probably better off using the nodejs tag.

Node-config is a popular package for managing configuration files for nodejs applications.

60 questions
0
votes
2 answers

Parse error when config reading the development.json

The config module is required in the index.js as this: const config = require("config"); But it throws an error when starting nodejs app with nodemon index.js. C:\d\code\js\emps_backend\node_modules\config\lib\config.js:838 throw new…
user938363
  • 9,990
  • 38
  • 137
  • 303
0
votes
1 answer

How can I hoist a variable above all imports in ES6?

Basically I'm using babel to transpile my nodejs app so I can use es6, as well as the node-config package. The node-config package by default looks for configs in the /config folder. This is reassignable by doing something like this BEFORE config is…
user5113508
0
votes
1 answer

Deploy Firebase functions with node-config

I created a firebase function that uses this config library https://www.npmjs.com/package/config. When I run it locally everything works. When I try to deploy, firebase deploy --only functions the config directory and related files in the functions…
0
votes
0 answers

can't access .env with node-config

I want to access my local .env file with node-config, but node-config always accesses my system env. local .env means which env file exists on my project folder. // development.js require('dotenv').config(); module.exports = { port: 4000, …
SNA Nilim
  • 211
  • 1
  • 3
  • 8
0
votes
1 answer

NodeJS - config does not load configuration file

I am using the config module for NodeJS. The configuration files are copied in the output direction properly. However, the config module still does not load them. import config from 'config'; // Prints "undefined" console.log(config); The…
Jecho Jekov
  • 1,358
  • 16
  • 15
0
votes
1 answer

What does this error info. from node/express mean?

I have this simple local.JSON file I use with node-config: { "MySQL": { "connection": "mysql://root:foo@localhost/heroku_d093ad5a46d841c?reconnect=true", }, "Mongoose": { "connection": "mongodb://localhost/myapp" } } However, I…
0
votes
2 answers

How does one include Heroku environment variables using node-config?

Currently I'm using this pattern in code: module.exports.getMySQL = () => { return process.env.CLEARDB_DATABASE_URL || config.get('MySQL').connection; } however, node-config claims to be able to integrate these variables into a file as…
user9473709
0
votes
1 answer

Node-config global configuration

I'm using latest node-config. Currently, I have a couple of projects with local configs and another project with general config. This my current structure: ProjectA/configs/{production, staging, integration} ProjectB/configs/{production, staging,…
xercool
  • 4,179
  • 6
  • 27
  • 33
0
votes
2 answers

How to get the node config in html file

I have a node config according to the environment. https://github.com/lorenwest/node-config default.json { "server": { "host": "localhost", "protocol": "http", "port": 9011 } } I want to get this in the index.html inside