# gemini-configparser

> Config parser module for gemini

Latest version **1.4.2** (published 2024-09-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install gemini-configparser
pnpm add gemini-configparser
yarn add gemini-configparser
bun add gemini-configparser
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.2 |
| Published | 2024-09-04 |
| First published | 2015-07-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 16.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sergey Tatarintsev |
| Maintainers | sevinf, j0tunn, unlok, dudagod, sipayrt, xrsd, oldskytree, shadowusr, kuznetsovroman |

## Links

- npm: https://www.npmjs.com/package/gemini-configparser
- npm.io page: https://npm.io/package/gemini-configparser

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.4

## Recent versions

- 1.4.2 (latest) — 2024-09-04
- 1.4.1 — 2024-04-03
- 1.4.0 — 2024-04-02
- 1.3.2 — 2023-09-08
- 1.3.1 — 2022-09-26
- 1.3.0 — 2022-03-17
- 1.2.0 — 2022-03-03
- 1.1.1 — 2021-12-06
- 1.1.0 — 2021-08-11
- 1.0.1 — 2021-06-09
- 1.0.0 — 2017-10-18
- 0.4.0 — 2017-08-01
- 0.3.0 — 2016-09-07
- 0.2.0 — 2016-05-26
- 0.1.2 — 2015-08-27
- … 2 more at https://npm.io/package/gemini-configparser/versions

## README

# @gemini/configparser

Parser for [`testplane`](https://github.com/gemini-testing/testplane) configuration files.

Config is described with a combination of a functions:

```js
var parser = root(section({
    system: section({
        parallelLimit: option({
            parseEnv: Number,
            parseCli: Number,
            validate: function() {...}
        })
    }),
    browsers: map(
        section({
            calibrate: option(...),
            windowSize: option(...)
        })
    )
})
```

There are 4 types of values:

* `option({defaultValue, parseCli, parseEnv, validate, map})` - a single scalar option.
    - `defaultValue` - a default value to use if option is not provided
    - `defaultValue(config, currentNode)` - a function to compute default value
    - `parseCli(value)` - a function used to parse command-line arguments
    - `parseEnv(value)` - a function used to parse environment variable
    - `validate(value, config, currentNode, meta)` - a function used to validate the option value
    - `map(value, config, currentNode, meta)` - a function used to transform the option value
* `section({sectionName1: valueParser1, sectionName2: valueParser2, ...})` - a section of a
  values with specified key names. Each option will parsed with appropriate parser function.
  Any unknown value passed by user will be treated as an error.
* `map(valueParser, defaultValue)` - a map with any number of user-specified keys. Each value is parsed by
  `valueParser`. If set, `defaultValue` will be used in case of no user-specified data provided.
* `root(parser, {envPrefix, cliPrefix})` - creates a root config parsers from specifed parser function. Returns function with signature `f({options, env, argv})`.

---
_Source: https://npm.io/package/gemini-configparser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
