Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/boneskull/rc-yaml
Extend the "rc" module with YAML parsing
https://github.com/boneskull/rc-yaml
cli config configuration json parse parsing rc rc-yaml yaml
Last synced: 3 months ago
JSON representation
Extend the "rc" module with YAML parsing
- Host: GitHub
- URL: https://github.com/boneskull/rc-yaml
- Owner: boneskull
- Created: 2015-07-23T06:00:54.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-20T08:50:56.000Z (almost 8 years ago)
- Last Synced: 2024-09-24T15:36:07.604Z (3 months ago)
- Topics: cli, config, configuration, json, parse, parsing, rc, rc-yaml, yaml
- Language: JavaScript
- Homepage:
- Size: 30.3 KB
- Stars: 2
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rc-yaml
rc + YAML - INI = this module
This module cannibalizes the [**rc**](https://www.npmjs.com/package/rc) module and tries to parse a [YAML](http://yaml.org) "rc" file, in addition to JSON and INI formats.
## Key Differences Between this and **rc**
- Well, if the "rc" file is not JSON, we try YAML, then fall back to INI.
- Since there's crossover between INI and YAML, we choose YAML if the YAML parser doesn't return a `String` value. So, if we end up with a `String`, we call it INI. The end.## Usage
```js
var rc = require('rc-yaml');var config = rc('name', {
defaults: 'go here'
});
```Custom parsers are still supported. See [**rc**'s `README.md`](https://github.com/dominictarr/rc/blob/master/README.md) for full usage.
If you just want the parsing function for some reason, it's accessible via:
```js
var parser = require('rc-yaml').parser;
```## A Note About Peer Dependencies
This module *depends on* the **rc** module, which means installing them both side-by-side is unnecessary. One or the other, people.
Using `peerDependencies` here may be more politically correct, but at a cost. Since **rc** is "for lazy people", when in Rome...
## Author, Somewhat
[Christopher Hiller](https://boneskull.com)
## License
MIT