Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 26 days 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 (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-25T19:55:34.000Z (about 8 years ago)
- Last Synced: 2024-11-23T15:08:07.754Z (30 days 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.
[![Dependency Status](https://david-dm.org/zkochan/yaml-or-json/status.svg?style=flat)](https://david-dm.org/zkochan/yaml-or-json)
[![Build Status](http://img.shields.io/travis/zkochan/yaml-or-json.svg?style=flat)](https://travis-ci.org/zkochan/yaml-or-json)
[![npm version](https://badge.fury.io/js/yaml-or-json.svg)](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)