Installation
Requirements
- Node.js 18+ or Bun 1.0+
- React 18+
Install inkx
bash
bun add inkxbash
npm install inkxbash
yarn add inkxbash
pnpm add inkxTypeScript 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.tsxbash
npx tsx app.tsxbash
npx ts-node --esm app.tsxTesting 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")
})