read-yaml-promise
Promise to read and parse a YAML file
var readYaml = ; // fixture.yaml// - 'foo'// - false ;
Installation
npm install read-yaml-promise
API
var readYaml = ;
readYaml(filePath [, options])
filePath: String
(file path)
options: Object
(options for js-yaml's safeLoad method and fs.readFile), or String
(file encoding)
Return: Object
(Promise)
When it finish reading and parsing a YAML file, it will be fulfilled with an Object
of the parsed data as its first argument.
When it fails to read or parse a file, it will be rejected with an error as its first argument.
var readYaml = ;var FAILSAFE_SCHEMA = FAILSAFE_SCHEMA; // npm install js-yaml // fixture.yml (foo: true) ; ;
options
Note that filename
option is automatically specified using the first argument.
License
Copyright (c) 2014 Shinnosuke Watanabe
Licensed under the MIT License.