Skip to content

Installation

Requirements

  • Node.js 18+ or Bun 1.0+
  • React 18+

Install inkx

bash
bun add inkx
bash
npm install inkx
bash
yarn add inkx
bash
pnpm add inkx

TypeScript Support

inkx includes TypeScript definitions out of the box. No additional @types packages needed.

json
// tsconfig.json
{
  "compilerOptions": {
    "jsx": "react-jsx",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true
  }
}

Running Your App

inkx apps are just TypeScript/JavaScript files. Run them directly:

bash
bun run app.tsx
bash
npx tsx app.tsx
bash
npx ts-node --esm app.tsx

Testing inkx Apps

inkx includes a testing library with auto-cleanup between renders:

tsx
import { createRenderer } from "inkx/testing"
import { Text } from "inkx"

const render = createRenderer()

test("renders hello", () => {
  const { lastFrame } = render(<Text>Hello</Text>)
  expect(lastFrame()).toContain("Hello")
})

test("renders world", () => {
  // Previous render is auto-cleaned when render() is called again
  const { lastFrame } = render(<Text>World</Text>)
  expect(lastFrame()).toContain("World")
})

Released under the MIT License.