yaml-or-json
Requires a yaml or json config file depending on what it finds.
Last updated 11 years ago by zkochan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install yaml-or-json 
SYNC missed versions from official npm registry.

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

The MIT License (MIT)

Current Tags

  • 0.2.0                                ...           latest (11 years ago)

2 Versions

  • 0.2.0                                ...           11 years ago
  • 0.1.0                                ...           11 years ago
Maintainers (1)
Downloads
Total 3
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 2
Last Month 0
Dependencies (2)
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE