@types/edit-json-file
TypeScript icon, indicating that this package has built-in type declarations

1.7.3 • Public • Published

Installation

npm install --save @types/edit-json-file

Summary

This package contains type definitions for edit-json-file (https://github.com/IonicaBizau/edit-json-file#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/edit-json-file.

/// <reference types= "node" />

import { NoParamCallback } from "fs";
import * as set from "set-value";

declare namespace editJsonFile {
    /** JSON file editor options. */
    interface Options {
        stringify_width?: number | undefined;
        stringify_fn?: ((data: object) => string) | undefined;
        stringify_eol?: boolean | undefined;
        autosave?: boolean | undefined;
        ignore_dots?: boolean | undefined;
    }

    /** JSON file editor. */
    interface JsonEditor {
        /** Get value at path. */
        get(path?: string): any;
        /** Set value at path. */
        set(path: string, value: any, options?: set.Options): JsonEditor;
        /** Appends a value/object to a specific path. */
        append(path: string, value: any): JsonEditor;
        /** Pop an array from a specific path. */
        pop(path: string): JsonEditor;
        /** Unset value at path. */
        unset(path: string): JsonEditor;
        /** Read the JSON file. */
        read(cb?: NoParamCallback): object;
        /** Overwrite the JSON file. */
        write(content: string, cb?: NoParamCallback): JsonEditor;
        /** Empty the JSON file. */
        empty(cb?: NoParamCallback): JsonEditor;
        /** Save the JSON file back to disk. */
        save(cb?: NoParamCallback): JsonEditor;
        /** Get full object. */
        toObject(): object;
    }
}

/** Create a JSON file editor. */
declare function editJsonFile(path: string, options?: editJsonFile.Options): editJsonFile.JsonEditor;

export = editJsonFile;

Additional Details

Credits

These definitions were written by Twixes.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.7.31,964ts5.7
1.7.31,964ts5.6
1.7.31,964latest
1.7.31,964ts4.5
1.7.31,964ts4.6
1.7.31,964ts4.7
1.7.31,964ts4.8
1.7.31,964ts4.9
1.7.31,964ts5.0
1.7.31,964ts5.1
1.7.31,964ts5.2
1.7.31,964ts5.3
1.7.31,964ts5.4
1.7.31,964ts5.5
1.7.31,964ts5.8
1.7.01,027ts3.8
1.7.01,027ts3.9
1.7.01,027ts4.0
1.7.01,027ts4.1
1.7.01,027ts4.2
1.7.01,027ts4.3
1.7.01,027ts4.4
1.4.0642ts3.0
1.4.0642ts3.1
1.4.0642ts3.2
1.4.0642ts3.3
1.4.0642ts3.4
1.4.0642ts3.5
1.6.198ts3.7
1.6.02ts3.6

Version History

VersionDownloads (Last 7 Days)Published
1.7.31,964
1.7.21
1.7.11
1.7.01,027
1.6.198
1.6.02
1.4.10
1.4.0642

Package Sidebar

Install

npm i @types/edit-json-file

Weekly Downloads

524

Version

1.7.3

License

MIT

Unpacked Size

5.84 kB

Total Files

5

Last publish

Collaborators

  • types