yaml-or-json

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

MIT 2 个版本
安装
npm install yaml-or-json
yarn add yaml-or-json
pnpm add yaml-or-json
bun add yaml-or-json
README

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)

版本列表
0.2.0 2016-01-10
0.1.0 2015-08-30