# markdown-to-ts

> Creating Types, tsx with Markdown

Latest version **0.1.4** (published 2023-03-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install markdown-to-ts
pnpm add markdown-to-ts
yarn add markdown-to-ts
bun add markdown-to-ts
```

Provides the command `md-cli`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2023-03-27 |
| First published | 2023-03-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jun |
| Maintainers | devbono |
| Keywords | markdown to tsx, markdown to typescript, typescript generator, type generator, type management, react, next.js |

## Links

- npm: https://www.npmjs.com/package/markdown-to-ts
- Repository: https://github.com/JunH-K/markdown-to-ts
- Homepage: https://github.com/JunH-K/markdown-to-ts.git
- Issues: https://github.com/JunH-K/markdown-to-ts/issues
- npm.io page: https://npm.io/package/markdown-to-ts

## Dependencies (1)

- [prettier](https://npm.io/package/prettier.md) ^2.8.6

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.4 (latest) — 2023-03-27
- 0.1.3 — 2023-03-25
- 0.1.2 — 2023-03-25
- 0.1.1 — 2023-03-25
- 0.1.0 — 2023-03-25
- 0.0.10 — 2023-03-25
- 0.0.9 — 2023-03-24
- 0.0.8 — 2023-03-24
- 0.0.7 — 2023-03-24
- 0.0.6 — 2023-03-23
- 0.0.5 — 2023-03-23
- 0.0.4 — 2023-03-23
- 0.0.3 — 2023-03-23
- 0.0.2 — 2023-03-23
- 0.0.1 — 2023-03-23

## README

# Markdown to typescript, tsx converter

[![npm](https://img.shields.io/npm/v/markdown-to-ts)](https://www.npmjs.com/package/markdown-to-ts)
[![Downloads](https://img.shields.io/npm/dt/markdown-to-ts.svg)](http://npm-stat.com/charts.html?package=markdown-to-ts)
[![license](https://img.shields.io/npm/l/markdown-to-ts)](https://img.shields.io/npm/l/markdown-to-ts)




Create type,tsx based on the markdown table.



> Supported Node.js

Supports versions 10 and above

> Install

```bash
npm i -g markdown-to-ts
```

> Usage

1. If there is no xxx.type.md file in the current path, Sample.type.md is created.
```bash
md-cli type
```
* Sample.type.md

```md
| key      | type                             | description   |
|----------|----------------------------------|---------------|
| basic?   | string                           | Optional type |
| union    | number,string                    | UnionType     |
| union2   | "name","age"                     | UnionType     |
| tuple    | [number,string]                  | TupleType     |
| tuple2   | ["string",1,{}]                  | TupleType     |
| argsFunc | (args:number,args2:string)=>void | function      |

```


2. Reads the xxx.type.md file in the current path and creates the xxx.ts file.
```bash
md-cli type
```
* SampleType.ts
```typescript
type SampleType = {
    basic?: string; //Optional type
    union: number | string; //UnionType
    union2: 'name' | 'age'; //UnionType
    tuple: [number, string]; //TupleType
    tuple2: ['string', 1, {}]; //TupleType
    argsFunc: (args: number, args2: string) => void; //function
};
export default SampleType;

```

3. Reads the xxx.type.md file in the current path and creates the xxx.tsx file.
```bash
md-cli component
```

* Sample.tsx
```typescript
type Props = {
    basic?: string; //Optional type
    union: number | string; //UnionType
    union2: 'name' | 'age'; //UnionType
    tuple: [number, string]; //TupleType
    tuple2: ['string', 1, {}]; //TupleType
    argsFunc: (args: number, args2: string) => void; //function
    [key: string]: any;
};

function Sample(props: Props) {
    return <div>Sample Component</div>;
}

export default Sample;

```

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