# @types/json2md

> TypeScript definitions for json2md

Latest version **1.5.4** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/json2md
pnpm add @types/json2md
yarn add @types/json2md
bun add @types/json2md
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.5.4 |
| Published | 2023-11-07 |
| First published | 2017-07-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51449 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/json2md
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json2md
- npm.io page: https://npm.io/package/@types/json2md

## Recent versions

- 1.5.4 (latest) — 2023-11-07
- 1.5.1 (ts3.6) — 2021-07-08
- 1.5.0 (ts2.3) — 2017-07-14
- 1.5.3 — 2023-10-18
- 1.5.2 — 2023-09-15

## README

# Installation
> `npm install --save @types/json2md`

# Summary
This package contains type definitions for json2md (https://github.com/IonicaBizau/json2md#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json2md.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json2md/index.d.ts)
````ts
export = json2md;

/**
 * Converts a JSON input to markdown.
 *
 * @param data The input JSON data.
 * @param prefix A snippet to add before each line.
 * @return The generated markdown result.
 */
declare function json2md(data: json2md.DataObject | json2md.DataObject[] | string | string[], prefix?: string): string;
type json2md = typeof json2md;

declare namespace json2md {
    const converters: ConvertersMethods;

    namespace DefaultConverters {
        interface Converters {
            [converter: string]: any;
            blockquote: string | string[];
            code: CodeInput;
            h1: string | string[];
            h2: string | string[];
            h3: string | string[];
            h4: string | string[];
            h5: string | string[];
            h6: string | string[];
            img: ImgInput | ImgInput[];
            ol: string[];
            p: string | string[];
            table: TableInput;
            ul: string[];
        }

        interface ImgInput {
            title: string;
            source: string;
        }

        interface CodeInput {
            language?: string | undefined;
            content: string | string[];
        }

        interface TableInput {
            headers: string[];
            rows: Array<{ [column: string]: string }> | string[][];
        }
    }

    type DataObject = {
        [TConverter in keyof DefaultConverters.Converters]?: DefaultConverters.Converters[TConverter];
    };

    type ConverterCallback<TInput> = (input: TInput, json2md: json2md) => string;

    type ConvertersMethods = {
        [TConverter in keyof DefaultConverters.Converters]: ConverterCallback<DefaultConverters.Converters[TConverter]>;
    };
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 03:09:37 GMT
 * Dependencies: none

# Credits
These definitions were written by [MartynasZilinskas](https://github.com/MartynasZilinskas).

---
_Source: https://npm.io/package/@types/json2md · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
