Repository URL to install this package:
|
Version:
1.2.5 ▾
|
/// <reference types="node" />
import { existsSync } from 'fs';
/**
* @tutorial http://stackabuse.com/read-files-with-node-js/
* @param {String} absolutePath path to read from
*/
declare function read(absolutePath: string): string;
/**
* @param {any} absolutePath
* @param {Object | *} [fallback={}]
* @return {Object | *} parsed json or fallback object
*/
declare function readJSON(absolutePath: string, fallback?: {
readfailed: boolean;
}): any;
/**
* @description write contents to a path
* @param {String} absolutePath path to write content to
* @param {String | Object | Array | *} content serializes content to write to file
* @return {Boolean} wrote successfully
*/
declare function write(absolutePath: string, content: any): void;
declare const exists: typeof existsSync;
export { read, write, readJSON, exists };