yargs / yargs/yargs

Load a user config file if it exists

Open
#1,234 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
JavaScript
Stars
11.5k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

Hello

How do I load a user config file if it exists?

Let's say that I want to allow people to have a .my-service.json in the root folder of their project, or even in their home folder. How to say to yarns:
"The user defaults are stored somewhere in a file named 'my-service.json', if you find some, please load it..." ?

Thanks in advance !

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file, test, or implementation entry point is named. Start by locating yargs's existing configuration-loading behavior, then clarify the supported search locations and precedence for project and home-directory files; done requires an agreed behavior and documentation or tests describing it.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.