@types/prettyjson

v0.0.33
  • Types
  • ESM
  • CJS

TypeScript definitions for prettyjson

License
MIT
Deps
0
Install Size
5.3 kB/-
Vulns
0
Published

Get started

$npm install @types/prettyjson
$pnpm add @types/prettyjson
$yarn add @types/prettyjson
$bun add @types/prettyjson
$deno add npm:@types/prettyjson
$vlt install @types/prettyjson
# Usually installed as a dev dependency
$npm install -D @types/prettyjson
$pnpm add -D @types/prettyjson
$yarn add -D @types/prettyjson
$bun add -d @types/prettyjson
$deno add -D npm:@types/prettyjson
$vlt install -D @types/prettyjson

Readme

Installation

npm install --save @types/prettyjson

Summary

This package contains type definitions for prettyjson (https://github.com/rafeca/prettyjson).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/prettyjson.

index.d.ts

/**
 * Defines prettyjson version
 */
export declare var version: string;

/**
 * Render pretty json.
 *
 * @param data {any} Data to prettify.
 * @param options {IOptions} Hash with different options to configure the renderer.
 * @param indentation {number} Indentation size.
 *
 * @return {string} pretty serialized json data ready to display.
 */
export declare function render(data: any, options?: RendererOptions, indentation?: number): string;

/**
 * Render pretty json from a string.
 *
 * @param data {string} Serialized JSON data to prettify.
 * @param options {IOptions} Hash with different options to configure the renderer.
 * @param indentation {number} Indentation size.
 *
 * @return {string} pretty serialized json data ready to display.
 */
export declare function renderString(data: string, options?: RendererOptions, indentation?: number): string;

export interface RendererOptions {
    /**
     * Define behavior for Array objects
     */
    emptyArrayMsg?: string | undefined; // default: (empty)
    inlineArrays?: boolean | undefined;
    noAlign?: boolean | undefined;

    /**
     * Color definition
     */
    noColor?: boolean | undefined;
    keysColor?: string | undefined;
    dashColor?: string | undefined;
    numberColor?: string | undefined;
    stringColor?: string | undefined;

    defaultIndentation?: number | undefined;
}
Additional Details
  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: none

Credits

These definitions were written by Wael BEN ZID EL GUEBSI.

Weekly DownloadsAcross all versions

Versions

0.0.33
latestts4.5ts4.6ts4.7ts4.8ts4.9ts5.0ts5.1ts5.2ts5.3ts5.4ts5.5ts5.6ts5.7ts5.8ts5.9ts6.0
0.0.30
ts3.6ts3.7ts3.8ts3.9ts4.0ts4.1ts4.2ts4.3ts4.4
0.0.29
ts2.0ts2.1ts2.2ts2.3ts2.4ts2.5ts2.6ts2.7ts2.8ts2.9ts3.0ts3.1ts3.2ts3.3ts3.4ts3.5