yaml-or-json
Requires a yaml or json config file depending on what it finds.
Last updated 10 years ago by zkochan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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 (10 years ago)

2 Versions

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

Copyright 2013 - present © cnpmjs.org | Home |