@stryke/fs
Version:
A package containing various file system utilities that expand the functionality of NodeJs's built-in `fs` module.
23 lines (22 loc) • 873 B
TypeScript
export interface YamlReadOptions {
/**
* Compatibility with JSON.parse behavior. If true, then duplicate keys in a mapping will override values rather than throwing an error.
*/
json?: boolean;
}
/**
* Reads a YAML file and returns the object the YAML content represents.
*
* @param path - A path to a file.
* @param options - YAML parse options
* @returns Object the YAML content of the file represents
*/
export declare function readYamlFileSync<T extends object = any>(path: string, options?: YamlReadOptions): T;
/**
* Reads a YAML file and returns the object the YAML content represents.
*
* @param path - A path to a file.
* @param options - YAML parse options
* @returns Object the YAML content of the file represents
*/
export declare function readYamlFile<T extends object = any>(path: string, options?: YamlReadOptions): Promise<T>;