Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/persistence / dist / adapters / server / readwrite.d.ts
Size: Mime:
/// <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 };