# discord-tsx-factory

> Write Discord.js component in tsx without React.

Latest version **0.3.6-b** (published 2025-02-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install discord-tsx-factory
pnpm add discord-tsx-factory
yarn add discord-tsx-factory
bun add discord-tsx-factory
```

## Health

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

Positive: has types; no vulnerabilities; high maintenance score.

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

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.3.6-b |
| Published | 2025-02-12 |
| First published | 2022-04-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 58.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Seunghoon Lee |
| Maintainers | lshqqytiger |
| Keywords | discord.js, discord, tsx, jsx |

## Links

- npm: https://www.npmjs.com/package/discord-tsx-factory
- Repository: https://github.com/lshqqytiger/discord-tsx-factory
- Homepage: https://github.com/lshqqytiger/discord-tsx-factory#readme
- Issues: https://github.com/lshqqytiger/discord-tsx-factory/issues
- npm.io page: https://npm.io/package/discord-tsx-factory

## Dependencies (1)

- [discord.js](https://npm.io/package/discord.js.md) ^14.18.0

## Recent versions

- 0.3.6-b (latest) — 2025-02-12
- 0.3.6-a — 2025-02-12
- 0.3.6 — 2025-02-12
- 0.3.5 — 2025-01-17
- 0.3.4 — 2025-01-17
- 0.3.3 — 2025-01-17
- 0.3.2 — 2024-06-30
- 0.3.1 — 2023-07-02
- 0.3.0 — 2023-06-22
- 0.2.19-d — 2023-06-17
- 0.2.19-c — 2023-06-17
- 0.2.19-b — 2023-06-17
- 0.2.19-a — 2023-06-17
- 0.2.19 — 2023-06-17
- 0.2.18 — 2023-05-07
- … 52 more at https://npm.io/package/discord-tsx-factory/versions

## README

<a href="https://www.npmjs.com/package/discord-tsx-factory"><img src="https://img.shields.io/npm/v/discord-tsx-factory.svg?maxAge=3600" alt="npm version" /></a>

# About

Write Discord.js component in tsx.

`discord-tsx-factory` is compatible with `discord.js` version `14.10.0 - 14.11.0`. (See `peerDependencies`)

```tsx
import { createElement, Fragment, Client } from "discord-tsx-factory";
import * as Discord from "discord.js";

const client = new Client(...);

// Go to documents/EXAMPLES.md (visit GitHub) to check out example usages.
```

# Installation

Using npm

```bash
$ npm install --save discord.js@14.11.0 discord-tsx-factory
```

Using yarn

```bash
$ yarn add discord.js@14.11.0 discord-tsx-factory
```

You need to modify your tsconfig.json to use discord-tsx-factory:

```json
{
  "compilerOptions": {
    ...
    "jsx": "react",
    "jsxFactory": "createElement",
    "jsxFragmentFactory": "Fragment",
    ...
  },
  ...
}
```

# Example usage

Go to [EXAMPLES.md](https://github.com/lshqqytiger/discord-tsx-factory/blob/main/documents/EXAMPLES.md).

# Listening and Handling interactions

Go to [HANDLING_INTERACTIONS.md](https://github.com/lshqqytiger/discord-tsx-factory/blob/main/documents/HANDLING_INTERACTIONS.md).

## Command

`discord-tsx-commands` is now available on npmjs!

```tsx
import * as Discord from "discord.js";
import { createElement, Fragment } from "discord-tsx-factory";
import "discord-tsx-commands";
```

Check out [discord-tsx-commands on GitHub](https://github.com/lshqqytiger/discord-tsx-commands) for more information.

# Special Thanks

- [Lotinex](https://github.com/Lotinex)
- [Daldalso](https://discord.com/invite/F6Epqzyf) Discord Members

# License

MIT License

Copyright (c) 2022 이승훈

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