yargs VS node-config

Compare yargs vs node-config and see what are their differences.

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
yargs node-config
38 20
10,911 6,195
0.4% 0.4%
5.0 5.7
10 days ago 2 months ago
JavaScript JavaScript
MIT License GNU General Public License v3.0 or later
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

yargs

Posts with mentions or reviews of yargs. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-03-28.

node-config

Posts with mentions or reviews of node-config. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-10-03.
  • topoconfig: enhancing config declarations with graphs
    10 projects | dev.to | 3 Oct 2023
    node-config
  • How We Converted a GitHub Tool Into a General Purpose Webhook Proxy to Supercharge Our Integration Development
    10 projects | dev.to | 21 Apr 2023
    This will allow to set a security operation mode and configure the channels. I chose to use the config package as I had good experience with it and it supports cascading config options.
  • Tailwind CSS: Using dynamic breakpoints and container queries
    2 projects | dev.to | 23 Feb 2023
    Tailwind CSS v3.2.4 includes a new @config directive that lets you specify which Tailwind CSS config to use for that file.
  • Managing Your Distributed Node.js Application Environment and Configuration
    2 projects | dev.to | 19 Oct 2022
    In this article, I'm going to demonstrate how the dotenv and node-config NPM packages can be used together to keep your Node.js application code organized across environments.
  • NextJS - Get rid of DotENV
    2 projects | dev.to | 31 Mar 2022
    I always disliked the .env file. Almost every time I was forced to place it on the top level of my app directory. At some point i started to use the npm config package. This gives the application a consistent configuration interface and there is a formidable way to implement it into the NextJS environment. For people which prefer code over text, feel free to checkout the finished implementation.
  • Advice for writing enterprise-level API in Go?
    8 projects | /r/learngolang | 18 Dec 2021
    How do I handle configs? In our Node APIs we use this config package, which allows us to override default configs on a per-environment basis. What's the standard way of doing this in Go?
  • The Perfect Configuration Format? Try TypeScript
    17 projects | news.ycombinator.com | 17 Nov 2021
    I have used TypeScript for config in a few projects, with node-config[1], and it’s substantially better IME than JSON/YAML/etc. Yeah it’s unconventional to write configs in a general purpose language, and I understand why that would be undesirable. But having configs validated at compile time is great at preventing bugs.

    I’m not sure I’d recommend node-config (it was chosen by a past team). Its magic undermines the confidence in type safety provided by choosing TypeScript in the first place. But it does give some good baseline conventions one can apply without all the magic.

    1: https://github.com/lorenwest/node-config

  • Serverless functions with FN project
    3 projects | dev.to | 6 Oct 2021
    docker run --rm -it --link fnserver:api -p 4000:4000 -e "FN_API_URL=http://api:8080" fnproject/ui Unable to find image 'fnproject/ui:latest' locally latest: Pulling from fnproject/ui b56ae66c2937: Pull complete e93c4ef66dd7: Pull complete a9e499bf0a12: Pull complete ba1608f40908: Pull complete 6464d2649fbf: Pull complete ebc7db4cf098: Pull complete f34c1cd5ef21: Pull complete dc688e6ebaad: Pull complete Digest: sha256:82c5b2fd02d702d2294bb107c1c022dba699241f64e4e14b77519d4c25bbb5f9 Status: Downloaded newer image for fnproject/ui:latest > [email protected] start /app > node server WARNING: NODE_ENV value of 'production' did match any deployment config file names. WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode info: Using API url: api:8080 info: Server running on port 4000
  • A simple configuration file loader and compositor utility.
    3 projects | /r/node | 1 Sep 2021
    Looks like the config module, but more steps needed to make it work. Is there anything that makes your module the better solution for your problem?
    3 projects | /r/node | 1 Sep 2021
    Thank you for your detailed answer. I think you did miss the correct approach to using ENV vars in the config module, which would be to have a separate file called 'custom-environment-variables.json' that maps your environment variables to the right property. For example: config/default.js module.exports = { db: { user: 'dev-user', password: '123456', host: 'db', name: 'application' } } config/custom-environment-variables.json { "db": { "user": "DB_USER", "password": "DB_PASSWORD", "host": "DB_HOST" } } db.js const dbConfig = require('config').get('db'); console.log(dbConfig); Run: DB_USER=prod-user DB_PASSWORD=abcdef DB_HOST=prod node db.js Output: { "user": "prod-user", "password": "abcdef", "host": "db", "name": "application" } Config composition is actually configs greatest feature I would say. Though the priority chain in the config module is hardcoded (see: https://github.com/lorenwest/node-config/wiki/Configuration-Files), while in yours you can actually which source takes priority.

What are some alternatives?

When comparing yargs and node-config you can also consider the following projects:

minimist - parse argument options

Inquirer.js - A collection of common interactive command line user interfaces.

meow - 🐈 CLI app helper

oclif - CLI for generating, building, and releasing oclif CLIs. Built by Salesforce.

vorpal - Node's framework for interactive CLIs

cross-env

get-stdin - Get stdin as a string or buffer

viper - Go configuration with fangs

configstore - Easily load and persist config without having to think about where and how

furious-commander - Testable and easily usable CLI framework

chalk - 🖍 Terminal string styling done right