UNPKG

read-file-yaml

Version:

Reads YAML 1.2 from a file. Returns null if file does not exist (or is a directory) instead of throwing an Error.

14 lines 437 B
/** @module read-file-yaml */ declare module "read-file-yaml" { /** * @function * @param {string} file Path to a file * @returns {Promise<Object|null>} Object returned from YAML parsing * @example * import readFileYaml from "read-file-yaml" * const result = await readFileYaml("package.yml") * result.version === "1.2.3" */ export default function(file: string): Promise<object | null>; }