• Version 1.0.36
  • Published
  • 4.67 kB
  • No dependencies
  • MIT license


npm i @types/json-stable-stringify
yarn add @types/json-stable-stringify
pnpm add @types/json-stable-stringify


TypeScript definitions for json-stable-stringify



function stringify

stringify: (obj: any, opts?: stringify.Comparator | stringify.Options) => string;
  • Deterministic version of JSON.stringify() so you can get a consistent hash from stringified results.


    Deterministic json result.


interface Element

interface Element {}

    property key

    key: string;

      property value

      value: any;

        interface Options

        interface Options {}

          property cmp

          cmp?: Comparator;
          • Custom comparator for key

          property cycles

          cycles?: boolean;
          • true to allow cycles, by marking the entries as __cycle__.

          property replacer

          replacer?: Replacer;
          • Option to replace values to simpler values

          property space

          space?: string | number;
          • Indent the output for pretty-printing.

            Supported is either a string or a number of spaces.

          Type Aliases

          type Comparator

          type Comparator = (a: Element, b: Element) => number;

            type Replacer

            type Replacer = (key: string, value: any) => any;

              Package Files (1)

              Dependencies (0)

              No dependencies.

              Dev Dependencies (0)

              No dev dependencies.

              Peer Dependencies (0)

              No peer dependencies.


              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/json-stable-stringify.

              • Markdown
              • HTML
                <a href="https://www.jsdocs.io/package/@types/json-stable-stringify"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>