Skip to content

zkochan/yaml-or-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yaml-or-json

Requires a yaml or json config file depending on what it finds.

Dependency Status Build Status npm version

Installation

npm install --save yaml-or-json

Usage

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.

License

MIT © Zoltan Kochan

About

Requires a yaml or json config file depending on what it finds.

Resources

License

Stars

Watchers

Forks

Packages

No packages published