Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

208
Vistas
Is there a way to define configuration structure for intellisense with "config" npm package?

I am using config module from npm with JS or TS. let's imagine I have the following default.json:

{
  "database": {
    "username": "admin",
    "password": "admin"
 }
}

then somewhere in my code I write

import config from "config";
// ...
config.get('database.username') //

Thing I would like to have is some kind of hint during coding of what I can get from config. I can think of usage of constants like

const CONFIG = {
  DATABASE: {
    USERNAME: "database.username",
    PASSWORD: "database.password"
  }
}
// and then
const { DATABASE } = CONFIG;
config.get(DATABASE.USERNAME)

but maybe there is some other way, more automatic than manual as we already have this information in configuration files.

Is there a way to achieve this?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda