cosmiconfig
main
Our great sponsors
cosmiconfig | main | |
---|---|---|
5 | 2 | |
3,835 | 272 | |
1.3% | 2.9% | |
8.3 | 3.2 | |
2 months ago | about 1 month ago | |
TypeScript | JavaScript | |
MIT License | Apache License 2.0 |
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.
cosmiconfig
-
topoconfig: enhancing config declarations with graphs
Meanwhile, formats have been evolving (JSON5, YAML), config entry points are constantly changing. These fluctuations, fortunately, were covered by tools like the cosmiconfig.
-
Moving all config files to a config folder in React?
I've heard of cosmicconfig, which I think allows you to put most of your config files in a single .config folder. I've never used it though.
-
Create a Node.js command-line library with NRWL NX workspace
There is a fantastic library davidtheclark/cosmiconfig: Find and load configuration from a package.json property, rc file, or CommonJS module that does all the tedious work for you.
-
Rob Pike: “Dotfiles” being hidden is a UNIXv2 mistake (2012)
info on XDG: [the XDG spec](https://standards.freedesktop.org/basedir-spec/basedir-spec-...)
tools that respect XDG, for fellow JS CLI developers:
- https://github.com/davidtheclark/cosmiconfig Find and load configuration from a package.json property, rc file, or CommonJS module. [Check `searchPaths` to implement XDG spec compliance.](https://github.com/davidtheclark/cosmiconfig/issues/152)
- Sindre's libraries use [`env-paths`](https://github.com/sindresorhus/env-paths#pathsconfig) to get paths compliant with this.
- https://github.com/sindresorhus/conf simple config storing (maybe try [conf-cli](https://github.com/natzcam/conf-cli) to manipulate if needed) the successor to [configstore](https://github.com/sindresorhus/conf#how-is-this-different-f...)
- https://github.com/jonschlinkert/data-store conf like datastore but in the shclinkerverse
-
A Node.js configuration provider reading files, environment and arguments
cosmiconfig - Reads configuration from a file. It searches for many file types and file names, and even supports defining config in the package.json file. Very customizable, it's an awesome library very flexible both for the app developer and for the app user.
main
-
My code is always buggy
Here's an example of a test that covers a lot: Let's say that you have a view that shows a list of users. To get those users you would most likely have a backend that has some API. You can request that API with Postman, that way you know that your request is valid, and you get a very realistic response (assuming this is a test environment or whatever. Just don't use production data). Then you use something like MockServer and set up the request as expectation and the response as what should be returned. After that, you can write a test that verifies that the correct number (with some tactically chosen verification of values) of users show up in the list. Now you have a test that covers a huge portion of the codebase, while being very user-centric and easy to maintain.
-
A Node.js configuration provider reading files, environment and arguments
@mocks-server/config - It allows to define configuration options, and it reads environment variables and uses cosmiconfig and commander under the hood to provide values to them.
What are some alternatives?
Commander.js - node.js command-line interfaces made easy
mocktail - Free, 11MB, containerized, self-hosted mock server.
data-store - Easily get, set and persist config data. Fast. Supports dot-notation in keys. No dependencies.
middie - Middleware engine for Fastify.
conf-cli - simple cli for configuration and key/value's + oclif plugin for configuration
DeepfakeHTTP - DeepfakeHTTP is a web server that uses HTTP dumps as a source for responses.
config - Helps you find, load, combine, autofill and validate configuration values of any kind
nodejs-mongodb-backend-boilerplate - Best Backend Boilerplate for MERN Stack.
misc - Experiment on maintaining a multi-project monorepository
pageres-cli - Capture website screenshots
.files - dotfiles for all my configs.
openapi-enricher - Enrich an OpenAPI spec with response examples to mock it efficiently