Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

212
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!