https://github.com/zkochan/yaml-or-json
Requires a yaml or json config file depending on what it finds.
https://github.com/zkochan/yaml-or-json
Last synced: 4 months ago
JSON representation
Requires a yaml or json config file depending on what it finds.
- Host: GitHub
- URL: https://github.com/zkochan/yaml-or-json
- Owner: zkochan
- License: mit
- Created: 2015-08-30T21:16:14.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-11-25T19:55:34.000Z (over 8 years ago)
- Last Synced: 2025-03-11T11:42:55.794Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yaml-or-json
Requires a yaml or json config file depending on what it finds.
[](https://david-dm.org/zkochan/yaml-or-json)
[](https://travis-ci.org/zkochan/yaml-or-json)
[](http://badge.fury.io/js/yaml-or-json)## Installation
```
npm install --save yaml-or-json
```## Usage
```js
var yamlOrJSON = require('yaml-or-json');var config = yamlOrJSON(__dirname + '/config/my-config');
console.log(config.someProperty);
```This will read and parse `my-config.yaml` or `my-config.yml` or `my-config.json` from the config
directory, depending which file will be there.## JSON5 is supported!
JSON files are parsed by [JSON5 parser](https://www.npmjs.com/package/json5).
## License
MIT © [Zoltan Kochan](https://www.kochan.io)