open-index/open-npm huggingface dataset:
npm package: @ktjs/babel-plugin-ktjsx
Description: Babel plugin to make JSX-generated SVG use proper namespaces.
Author: Kasukabe Tsumugi
Latest version: 0.4.6

# KT.js

[![npm version](https://img.shields.io/npm/v/kt.js.svg)](https://www.npmjs.com/package/kt.js)
[![npm downloads](https://img.shields.io/npm/dm/kt.js.svg)](https://www.npmjs.com/package/kt.js)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

<p align="center">
  <a href="https://baendlorel.github.io/kt.js/">
    <img src="https://raw.githubusercontent.com/baendlorel/kt.js/refs/heads/main/assets/ktjs-0.0.1.svg" width="240px" alt="KT.js logo" />
  </a>
</p>

<p align="center"><strong>Visit KT.js: <a href="https://baendlorel.github.io/kt.js/">https://baendlorel.github.io/kt.js/</a></strong></p>

> kt.js is still under development, so there might be some breaking changes. Note the Update Log below

## Recent Updates

1. `ref.value` remains the standard read API, and it can also replace the whole outer value with `ref.value = nextValue`.
2. `ref.draft` is the deep-mutation entry for nested objects, arrays, `Map` / `Set`, and custom mutable objects.
3. `ref.draft` itself is not assignable; mutate nested fields or call mutating methods on the returned object instead.
4. `addOnChange((newValue, oldValue) => ...)` keeps `oldValue` as the previous reference, not a deep snapshot.

## Community

- QQ Group: `1070434849`
- Telegram: https://t.me/kt_js

## Introduction

kt.js is a simple framework with a tiny runtime that renders real DOM directly (no virtual DOM), uses explicit reactivity variables and gives you manual control over refs, bindings, and redraw timing.

KT.js focuses on one principle: keep direct control of the DOM and avoid unnecessary repainting.

## Reactive Contract

```ts
const user = ref({ profile: { name: 'John' }, tags: ['new'] });

console.log(user.value.profile.name); // read

user.value = {
  ...user.value,
  profile: { ...user.value.profile, name: 'Jane' },
  tags: [...user.value.tags],
}; // replace the whole outer value

user.draft.profile.name = 'Jane'; // deep write
user.draft.tags.push('active'); // array / map / set / custom-object style mutation
```

Rules:

- Read with `.value`.
- Replace the whole outer value with `.value = nextValue`.
- Use `.draft` for deep mutations on nested objects, arrays, `Map` / `Set`, or other mutable instances.
- Do not assign to `.draft` itself; mutate inside it.
- `computed` stays read-only and is consumed through `.value`.
- `oldValue` in change listeners is the previous reference only, not a deep-cloned snapshot.
- Correctness is expected to come from the transformer and TypeScript checks; runtime hot paths stay minimal on purpose.

This is an explicit contract, closer to a Rust-style model than permissive runtime magic: unclear code should fail early.

## Quick Start

```bash
pnpm create kt.js my-app
cd my-app
pnpm install
pnpm dev
```
npm package: @ktjs/core
Description: Core functionality for kt.js - DOM manipulation utilities with JSX/TSX support
Author: Kasukabe Tsumugi
Latest version: 0.38.8

# KT.js

<p align="center">
  <a href="https://baendlorel.github.io/kt.js/">
    <img src="https://raw.githubusercontent.com/baendlorel/kt.js/refs/heads/main/assets/ktjs-0.0.1.svg" width="200px" alt="KT.js logo" />
  </a>
</p>
<p align="center">
  <img src="https://img.shields.io/npm/v/kt.js.svg"/>
  <img src="https://img.shields.io/npm/dm/kt.js.svg"/>
  <img src="https://img.shields.io/badge/License-MIT-yellow.svg"/>
</p>

<h4 align="center">Doc → <a href="https://baendlorel.github.io/kt.js/">https://baendlorel.github.io/kt.js/</a></h4>

> kt.js is still under development, there might be some breaking api changes.

## Recent Updates

1. 0.38.x - reactive helper additions
   1. `reactive.is(target)`: create a boolean computed based on `Object.is` comparison.
   2. `reactive.match(pattern)`: create a boolean computed using deep object/array pattern matching.
2. 0.37.x - fixes and refactors
   1. fix schedulers clear issue. Which would occur when some handler throws an error.
   2. `Fragment` is refactored. Fixes memory leak issues and makes it more robust.
3. 0.36.x - override 0.35.x. Now refs and computeds have 2 new apis:
   1. `get(...keys)`: create a `KTSubComputed` object. It is a light version of computed, used to bind values
   2. `subref(...keys)`: create a `KTSubRef` object. It is a light version of ref, used to bind values and also support two-way binding with `k-model`.
4. 0.34.x - `ref.notify()` no-longer has an optional argument.
5. 0.33.x - `ref.value` remains the standard read API, and it can also replace the whole outer value with `ref.value = nextValue`.
6. 0.33.x - `ref.draft` is the deep-mutation entry for literally any objects. Just use `someRef.draft.a = someValue`, and kt.js will add it to microqueue and redraw it on the next tick. Works for `Map`, `Set`, `Array`, `Date` and your custom objects.
   1. `ref.draft` itself is **not assignable**.
7. `addOnChange((newValue, oldValue) => ...)` keeps `oldValue` as the previous reference, not a deep snapshot.

## Community

- QQ Group: `1070434849`
- Telegram: https://t.me/kt_js

## Introduction

kt.js is a web framework with a tiny runtime that renders real DOM directly (no virtual DOM), uses explicit reactivity variables and gives you manual control over refs, bindings, and redraw timing.

KT.js focuses on one principle: keep direct control of the DOM and avoid unnecessary repainting.

## Quick Start

```bash
pnpm create kt.js my-app
cd my-app
pnpm install
pnpm dev
```

## Security model

kt.js intentionally trusts application code and keeps DOM operations explicit.

- Text children are inserted as text nodes by default.
- `k-html` is a raw HTML escape hatch that writes to `innerHTML` without sanitization.
- Prefer `on:*` event bindings. Do not pass raw `onclick` / `onerror` style strings.
- Attributes such as `href`, `src`, `srcdoc`, `action`, and SVG URL attributes are forwarded as-is.
- If you bind untrusted input, sanitization and validation must be handled by your application.

## License

MIT License.
npm package: @ktjs/mui
Description: Material-UI inspired components for kt.js - pre-styled UI components
Author: Kasukabe Tsumugi
Latest version: 0.38.8

# KT.js

<p align="center">
  <a href="https://baendlorel.github.io/kt.js/">
    <img src="https://raw.githubusercontent.com/baendlorel/kt.js/refs/heads/main/assets/ktjs-0.0.1.svg" width="200px" alt="KT.js logo" />
  </a>
</p>
<p align="center">
  <img src="https://img.shields.io/npm/v/kt.js.svg"/>
  <img src="https://img.shields.io/npm/dm/kt.js.svg"/>
  <img src="https://img.shields.io/badge/License-MIT-yellow.svg"/>
</p>

<h4 align="center">Doc → <a href="https://baendlorel.github.io/kt.js/">https://baendlorel.github.io/kt.js/</a></h4>

> kt.js is still under development, there might be some breaking api changes.

## Recent Updates

1. 0.38.x - reactive helper additions
   1. `reactive.is(target)`: create a boolean computed based on `Object.is` comparison.
   2. `reactive.match(pattern)`: create a boolean computed using deep object/array pattern matching.
2. 0.37.x - fixes and refactors
   1. fix schedulers clear issue. Which would occur when some handler throws an error.
   2. `Fragment` is refactored. Fixes memory leak issues and makes it more robust.
3. 0.36.x - override 0.35.x. Now refs and computeds have 2 new apis:
   1. `get(...keys)`: create a `KTSubComputed` object. It is a light version of computed, used to bind values
   2. `subref(...keys)`: create a `KTSubRef` object. It is a light version of ref, used to bind values and also support two-way binding with `k-model`.
4. 0.34.x - `ref.notify()` no-longer has an optional argument.
5. 0.33.x - `ref.value` remains the standard read API, and it can also replace the whole outer value with `ref.value = nextValue`.
6. 0.33.x - `ref.draft` is the deep-mutation entry for literally any objects. Just use `someRef.draft.a = someValue`, and kt.js will add it to microqueue and redraw it on the next tick. Works for `Map`, `Set`, `Array`, `Date` and your custom objects.
   1. `ref.draft` itself is **not assignable**.
7. `addOnChange((newValue, oldValue) => ...)` keeps `oldValue` as the previous reference, not a deep snapshot.

## Community

- QQ Group: `1070434849`
- Telegram: https://t.me/kt_js

## Introduction

kt.js is a web framework with a tiny runtime that renders real DOM directly (no virtual DOM), uses explicit reactivity variables and gives you manual control over refs, bindings, and redraw timing.

KT.js focuses on one principle: keep direct control of the DOM and avoid unnecessary repainting.

## Quick Start

```bash
pnpm create kt.js my-app
cd my-app
pnpm install
pnpm dev
```

## Security model

kt.js intentionally trusts application code and keeps DOM operations explicit.

- Text children are inserted as text nodes by default.
- `k-html` is a raw HTML escape hatch that writes to `innerHTML` without sanitization.
- Prefer `on:*` event bindings. Do not pass raw `onclick` / `onerror` style strings.
- Attributes such as `href`, `src`, `srcdoc`, `action`, and SVG URL attributes are forwarded as-is.
- If you bind untrusted input, sanitization and validation must be handled by your application.

## License

MIT License.
npm package: @ktjs/mui-icon
Description: Material-UI icon components for kt.js - pre-styled UI components
Author: Kasukabe Tsumugi
Latest version: 0.38.0

# KT.js

<p align="center">
  <a href="https://baendlorel.github.io/kt.js/">
    <img src="https://raw.githubusercontent.com/baendlorel/kt.js/refs/heads/main/assets/ktjs-0.0.1.svg" width="200px" alt="KT.js logo" />
  </a>
</p>
<p align="center">
  <img src="https://img.shields.io/npm/v/kt.js.svg"/>
  <img src="https://img.shields.io/npm/dm/kt.js.svg"/>
  <img src="https://img.shields.io/badge/License-MIT-yellow.svg"/>
</p>

<h4 align="center">Doc → <a href="https://baendlorel.github.io/kt.js/">https://baendlorel.github.io/kt.js/</a></h4>

> kt.js is still under development, there might be some breaking api changes.

## Recent Updates

1. 0.38.x - reactive helper additions
   1. `reactive.is(target)`: create a boolean computed based on `Object.is` comparison.
   2. `reactive.match(pattern)`: create a boolean computed using deep object/array pattern matching.
2. 0.37.x - fixes and refactors
   1. fix schedulers clear issue. Which would occur when some handler throws an error.
   2. `Fragment` is refactored. Fixes memory leak issues and makes it more robust.
3. 0.36.x - override 0.35.x. Now refs and computeds have 2 new apis:
   1. `get(...keys)`: create a `KTSubComputed` object. It is a light version of computed, used to bind values
   2. `subref(...keys)`: create a `KTSubRef` object. It is a light version of ref, used to bind values and also support two-way binding with `k-model`.
4. 0.34.x - `ref.notify()` no-longer has an optional argument.
5. 0.33.x - `ref.value` remains the standard read API, and it can also replace the whole outer value with `ref.value = nextValue`.
6. 0.33.x - `ref.draft` is the deep-mutation entry for literally any objects. Just use `someRef.draft.a = someValue`, and kt.js will add it to microqueue and redraw it on the next tick. Works for `Map`, `Set`, `Array`, `Date` and your custom objects.
   1. `ref.draft` itself is **not assignable**.
7. `addOnChange((newValue, oldValue) => ...)` keeps `oldValue` as the previous reference, not a deep snapshot.

## Community

- QQ Group: `1070434849`
- Telegram: https://t.me/kt_js

## Introduction

kt.js is a web framework with a tiny runtime that renders real DOM directly (no virtual DOM), uses explicit reactivity variables and gives you manual control over refs, bindings, and redraw timing.

KT.js focuses on one principle: keep direct control of the DOM and avoid unnecessary repainting.

## Quick Start

```bash
pnpm create kt.js my-app
cd my-app
pnpm install
pnpm dev
```

## Security model

kt.js intentionally trusts application code and keeps DOM operations explicit.

- Text children are inserted as text nodes by default.
- `k-html` is a raw HTML escape hatch that writes to `innerHTML` without sanitization.
- Prefer `on:*` event bindings. Do not pass raw `onclick` / `onerror` style strings.
- Attributes such as `href`, `src`, `srcdoc`, `action`, and SVG URL attributes are forwarded as-is.
- If you bind untrusted input, sanitization and validation must be handled by your application.

## License

MIT License.
npm package: @ktjs/router
Description: Router for kt.js - client-side routing with navigation guards
Author: Kasukabe Tsumugi
Latest version: 0.38.4

# KT.js

<p align="center">
  <a href="https://baendlorel.github.io/kt.js/">
    <img src="https://raw.githubusercontent.com/baendlorel/kt.js/refs/heads/main/assets/ktjs-0.0.1.svg" width="200px" alt="KT.js logo" />
  </a>
</p>
<p align="center">
  <img src="https://img.shields.io/npm/v/kt.js.svg"/>
  <img src="https://img.shields.io/npm/dm/kt.js.svg"/>
  <img src="https://img.shields.io/badge/License-MIT-yellow.svg"/>
</p>

<h4 align="center">Doc → <a href="https://baendlorel.github.io/kt.js/">https://baendlorel.github.io/kt.js/</a></h4>

> kt.js is still under development, there might be some breaking api changes.

## Recent Updates

1. 0.38.x - reactive helper additions
   1. `reactive.is(target)`: create a boolean computed based on `Object.is` comparison.
   2. `reactive.match(pattern)`: create a boolean computed using deep object/array pattern matching.
2. 0.37.x - fixes and refactors
   1. fix schedulers clear issue. Which would occur when some handler throws an error.
   2. `Fragment` is refactored. Fixes memory leak issues and makes it more robust.
3. 0.36.x - override 0.35.x. Now refs and computeds have 2 new apis:
   1. `get(...keys)`: create a `KTSubComputed` object. It is a light version of computed, used to bind values
   2. `subref(...keys)`: create a `KTSubRef` object. It is a light version of ref, used to bind values and also support two-way binding with `k-model`.
4. 0.34.x - `ref.notify()` no-longer has an optional argument.
5. 0.33.x - `ref.value` remains the standard read API, and it can also replace the whole outer value with `ref.value = nextValue`.
6. 0.33.x - `ref.draft` is the deep-mutation entry for literally any objects. Just use `someRef.draft.a = someValue`, and kt.js will add it to microqueue and redraw it on the next tick. Works for `Map`, `Set`, `Array`, `Date` and your custom objects.
   1. `ref.draft` itself is **not assignable**.
7. `addOnChange((newValue, oldValue) => ...)` keeps `oldValue` as the previous reference, not a deep snapshot.

## Community

- QQ Group: `1070434849`
- Telegram: https://t.me/kt_js

## Introduction

kt.js is a web framework with a tiny runtime that renders real DOM directly (no virtual DOM), uses explicit reactivity variables and gives you manual control over refs, bindings, and redraw timing.

KT.js focuses on one principle: keep direct control of the DOM and avoid unnecessary repainting.

## Quick Start

```bash
pnpm create kt.js my-app
cd my-app
pnpm install
pnpm dev
```

## Security model

kt.js intentionally trusts application code and keeps DOM operations explicit.

- Text children are inserted as text nodes by default.
- `k-html` is a raw HTML escape hatch that writes to `innerHTML` without sanitization.
- Prefer `on:*` event bindings. Do not pass raw `onclick` / `onerror` style strings.
- Attributes such as `href`, `src`, `srcdoc`, `action`, and SVG URL attributes are forwarded as-is.
- If you bind untrusted input, sanitization and validation must be handled by your application.

## License

MIT License.
npm package: @ktjs/shared
Description: Shared utilities and cached native methods for kt.js framework
Author: Kasukabe Tsumugi
Latest version: 0.38.0

# KT.js

<p align="center">
  <a href="https://baendlorel.github.io/kt.js/">
    <img src="https://raw.githubusercontent.com/baendlorel/kt.js/refs/heads/main/assets/ktjs-0.0.1.svg" width="200px" alt="KT.js logo" />
  </a>
</p>
<p align="center">
  <img src="https://img.shields.io/npm/v/kt.js.svg"/>
  <img src="https://img.shields.io/npm/dm/kt.js.svg"/>
  <img src="https://img.shields.io/badge/License-MIT-yellow.svg"/>
</p>

<h4 align="center">Doc → <a href="https://baendlorel.github.io/kt.js/">https://baendlorel.github.io/kt.js/</a></h4>

> kt.js is still under development, there might be some breaking api changes.

## Recent Updates

1. 0.38.x - reactive helper additions
   1. `reactive.is(target)`: create a boolean computed based on `Object.is` comparison.
   2. `reactive.match(pattern)`: create a boolean computed using deep object/array pattern matching.
2. 0.37.x - fixes and refactors
   1. fix schedulers clear issue. Which would occur when some handler throws an error.
   2. `Fragment` is refactored. Fixes memory leak issues and makes it more robust.
3. 0.36.x - override 0.35.x. Now refs and computeds have 2 new apis:
   1. `get(...keys)`: create a `KTSubComputed` object. It is a light version of computed, used to bind values
   2. `subref(...keys)`: create a `KTSubRef` object. It is a light version of ref, used to bind values and also support two-way binding with `k-model`.
4. 0.34.x - `ref.notify()` no-longer has an optional argument.
5. 0.33.x - `ref.value` remains the standard read API, and it can also replace the whole outer value with `ref.value = nextValue`.
6. 0.33.x - `ref.draft` is the deep-mutation entry for literally any objects. Just use `someRef.draft.a = someValue`, and kt.js will add it to microqueue and redraw it on the next tick. Works for `Map`, `Set`, `Array`, `Date` and your custom objects.
   1. `ref.draft` itself is **not assignable**.
7. `addOnChange((newValue, oldValue) => ...)` keeps `oldValue` as the previous reference, not a deep snapshot.

## Community

- QQ Group: `1070434849`
- Telegram: https://t.me/kt_js

## Introduction

kt.js is a web framework with a tiny runtime that renders real DOM directly (no virtual DOM), uses explicit reactivity variables and gives you manual control over refs, bindings, and redraw timing.

KT.js focuses on one principle: keep direct control of the DOM and avoid unnecessary repainting.

## Quick Start

```bash
pnpm create kt.js my-app
cd my-app
pnpm install
pnpm dev
```

## Security model

kt.js intentionally trusts application code and keeps DOM operations explicit.

- Text children are inserted as text nodes by default.
- `k-html` is a raw HTML escape hatch that writes to `innerHTML` without sanitization.
- Prefer `on:*` event bindings. Do not pass raw `onclick` / `onerror` style strings.
- Attributes such as `href`, `src`, `srcdoc`, `action`, and SVG URL attributes are forwarded as-is.
- If you bind untrusted input, sanitization and validation must be handled by your application.

## License

MIT License.
npm package: @ktjs/shortcuts
Description: Shortcut functions for kt.js - common DOM operations
Author: Kasukabe Tsumugi
Latest version: 0.36.2

# KT.js

<p align="center">
  <a href="https://baendlorel.github.io/kt.js/">
    <img src="https://raw.githubusercontent.com/baendlorel/kt.js/refs/heads/main/assets/ktjs-0.0.1.svg" width="200px" alt="KT.js logo" />
  </a>
</p>
<p align="center">
  <img src="https://img.shields.io/npm/v/kt.js.svg"/>
  <img src="https://img.shields.io/npm/dm/kt.js.svg"/>
  <img src="https://img.shields.io/badge/License-MIT-yellow.svg"/>
</p>

<h4 align="center">Doc → <a href="https://baendlorel.github.io/kt.js/">https://baendlorel.github.io/kt.js/</a></h4>

> kt.js is still under development, there might be some breaking api changes.

## Recent Updates

1. 0.36.x - override 0.35.x. Now refs and computeds have 2 new apis:
   1. `get(...keys)`: create a `KTSubComputed` object. It is a light version of computed, used to bind values
   2. `subref(...keys)`: create a `KTSubRef` object. It is a light version of ref, used to bind values and also support two-way binding with `k-model`.
2. 0.34.x - `ref.notify()` no-longer has an optional argument.
3. 0.33.x - `ref.value` remains the standard read API, and it can also replace the whole outer value with `ref.value = nextValue`.
4. 0.33.x - `ref.draft` is the deep-mutation entry for literally any objects. Just use `someRef.draft.a = someValue`, and kt.js will add it to microqueue and redraw it on the next tick. Works for `Map`, `Set`, `Array`, `Date` and your custom objects.
   1. `ref.draft` itself is **not assignable**.
5. `addOnChange((newValue, oldValue) => ...)` keeps `oldValue` as the previous reference, not a deep snapshot.

## Community

- QQ Group: `1070434849`
- Telegram: https://t.me/kt_js

## Introduction

kt.js is a web framework with a tiny runtime that renders real DOM directly (no virtual DOM), uses explicit reactivity variables and gives you manual control over refs, bindings, and redraw timing.

KT.js focuses on one principle: keep direct control of the DOM and avoid unnecessary repainting.

## Quick Start

```bash
pnpm create kt.js my-app
cd my-app
pnpm install
pnpm dev
```

## Security model

kt.js intentionally trusts application code and keeps DOM operations explicit.

- Text children are inserted as text nodes by default.
- `k-html` is a raw HTML escape hatch that writes to `innerHTML` without sanitization.
- Prefer `on:*` event bindings. Do not pass raw `onclick` / `onerror` style strings.
- Attributes such as `href`, `src`, `srcdoc`, `action`, and SVG URL attributes are forwarded as-is.
- If you bind untrusted input, sanitization and validation must be handled by your application.

## License

MIT License.
npm package: @ktjs/transformer
Description: Shared JSX transform core used by KT.js Babel and Vite plugins.
Author: Kasukabe Tsumugi
Latest version: 0.4.6

# KT.js

[![npm version](https://img.shields.io/npm/v/kt.js.svg)](https://www.npmjs.com/package/kt.js)
[![npm downloads](https://img.shields.io/npm/dm/kt.js.svg)](https://www.npmjs.com/package/kt.js)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

<p align="center">
  <a href="https://baendlorel.github.io/kt.js/">
    <img src="https://raw.githubusercontent.com/baendlorel/kt.js/refs/heads/main/assets/ktjs-0.0.1.svg" width="240px" alt="KT.js logo" />
  </a>
</p>

<p align="center"><strong>Visit KT.js: <a href="https://baendlorel.github.io/kt.js/">https://baendlorel.github.io/kt.js/</a></strong></p>

> kt.js is still under development, so there might be some breaking changes. Note the Update Log below

## Recent Updates

1. `ref.value` remains the standard read API, and it can also replace the whole outer value with `ref.value = nextValue`.
2. `ref.draft` is the deep-mutation entry for nested objects, arrays, `Map` / `Set`, and custom mutable objects.
3. `ref.draft` itself is not assignable; mutate nested fields or call mutating methods on the returned object instead.
4. `addOnChange((newValue, oldValue) => ...)` keeps `oldValue` as the previous reference, not a deep snapshot.

## Community

- QQ Group: `1070434849`
- Telegram: https://t.me/kt_js

## Introduction

kt.js is a simple framework with a tiny runtime that renders real DOM directly (no virtual DOM), uses explicit reactivity variables and gives you manual control over refs, bindings, and redraw timing.

KT.js focuses on one principle: keep direct control of the DOM and avoid unnecessary repainting.

## Reactive Contract

```ts
const user = ref({ profile: { name: 'John' }, tags: ['new'] });

console.log(user.value.profile.name); // read

user.value = {
  ...user.value,
  profile: { ...user.value.profile, name: 'Jane' },
  tags: [...user.value.tags],
}; // replace the whole outer value

user.draft.profile.name = 'Jane'; // deep write
user.draft.tags.push('active'); // array / map / set / custom-object style mutation
```

Rules:

- Read with `.value`.
- Replace the whole outer value with `.value = nextValue`.
- Use `.draft` for deep mutations on nested objects, arrays, `Map` / `Set`, or other mutable instances.
- Do not assign to `.draft` itself; mutate inside it.
- `computed` stays read-only and is consumed through `.value`.
- `oldValue` in change listeners is the previous reference only, not a deep-cloned snapshot.
- Correctness is expected to come from the transformer and TypeScript checks; runtime hot paths stay minimal on purpose.

This is an explicit contract, closer to a Rust-style model than permissive runtime magic: unclear code should fail early.

## Quick Start

```bash
pnpm create kt.js my-app
cd my-app
pnpm install
pnpm dev
```
npm package: @ktjs/ts-plugin
Description: TypeScript language service plugin for kt.js k-for scope names in TSX.
Author: Kasukabe Tsumugi
Latest version: 0.2.1

# KT.js

<p align="center">
  <a href="https://baendlorel.github.io/kt.js/">
    <img src="https://raw.githubusercontent.com/baendlorel/kt.js/refs/heads/main/assets/ktjs-0.0.1.svg" width="200px" alt="KT.js logo" />
  </a>
</p>
<p align="center">
  <img src="https://img.shields.io/npm/v/kt.js.svg"/>
  <img src="https://img.shields.io/npm/dm/kt.js.svg"/>
  <img src="https://img.shields.io/badge/License-MIT-yellow.svg"/>
</p>

<h4 align="center">Doc → <a href="https://baendlorel.github.io/kt.js/">https://baendlorel.github.io/kt.js/</a></h4>

> kt.js is still under development, there might be some breaking api changes.

## Recent Updates

1. 0.38.x - reactive helper additions
   1. `reactive.is(target)`: create a boolean computed based on `Object.is` comparison.
   2. `reactive.match(pattern)`: create a boolean computed using deep object/array pattern matching.
2. 0.37.x - fixes and refactors
   1. fix schedulers clear issue. Which would occur when some handler throws an error.
   2. `Fragment` is refactored. Fixes memory leak issues and makes it more robust.
3. 0.36.x - override 0.35.x. Now refs and computeds have 2 new apis:
   1. `get(...keys)`: create a `KTSubComputed` object. It is a light version of computed, used to bind values
   2. `subref(...keys)`: create a `KTSubRef` object. It is a light version of ref, used to bind values and also support two-way binding with `k-model`.
4. 0.34.x - `ref.notify()` no-longer has an optional argument.
5. 0.33.x - `ref.value` remains the standard read API, and it can also replace the whole outer value with `ref.value = nextValue`.
6. 0.33.x - `ref.draft` is the deep-mutation entry for literally any objects. Just use `someRef.draft.a = someValue`, and kt.js will add it to microqueue and redraw it on the next tick. Works for `Map`, `Set`, `Array`, `Date` and your custom objects.
   1. `ref.draft` itself is **not assignable**.
7. `addOnChange((newValue, oldValue) => ...)` keeps `oldValue` as the previous reference, not a deep snapshot.

## Community

- QQ Group: `1070434849`
- Telegram: https://t.me/kt_js

## Introduction

kt.js is a web framework with a tiny runtime that renders real DOM directly (no virtual DOM), uses explicit reactivity variables and gives you manual control over refs, bindings, and redraw timing.

KT.js focuses on one principle: keep direct control of the DOM and avoid unnecessary repainting.

## Quick Start

```bash
pnpm create kt.js my-app
cd my-app
pnpm install
pnpm dev
```

## Security model

kt.js intentionally trusts application code and keeps DOM operations explicit.

- Text children are inserted as text nodes by default.
- `k-html` is a raw HTML escape hatch that writes to `innerHTML` without sanitization.
- Prefer `on:*` event bindings. Do not pass raw `onclick` / `onerror` style strings.
- Attributes such as `href`, `src`, `srcdoc`, `action`, and SVG URL attributes are forwarded as-is.
- If you bind untrusted input, sanitization and validation must be handled by your application.

## License

MIT License.
npm package: @ktjs/vite-plugin-ktjsx
Description: Vite plugin that applies KT.js JSX transforms.
Author: Kasukabe Tsumugi
Latest version: 0.4.6

# KT.js

[![npm version](https://img.shields.io/npm/v/kt.js.svg)](https://www.npmjs.com/package/kt.js)
[![npm downloads](https://img.shields.io/npm/dm/kt.js.svg)](https://www.npmjs.com/package/kt.js)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

<p align="center">
  <a href="https://baendlorel.github.io/kt.js/">
    <img src="https://raw.githubusercontent.com/baendlorel/kt.js/refs/heads/main/assets/ktjs-0.0.1.svg" width="240px" alt="KT.js logo" />
  </a>
</p>

<p align="center"><strong>Visit KT.js: <a href="https://baendlorel.github.io/kt.js/">https://baendlorel.github.io/kt.js/</a></strong></p>

> kt.js is still under development, so there might be some breaking changes. Note the Update Log below

## Recent Updates

1. `ref.value` remains the standard read API, and it can also replace the whole outer value with `ref.value = nextValue`.
2. `ref.draft` is the deep-mutation entry for nested objects, arrays, `Map` / `Set`, and custom mutable objects.
3. `ref.draft` itself is not assignable; mutate nested fields or call mutating methods on the returned object instead.
4. `addOnChange((newValue, oldValue) => ...)` keeps `oldValue` as the previous reference, not a deep snapshot.

## Community

- QQ Group: `1070434849`
- Telegram: https://t.me/kt_js

## Introduction

kt.js is a simple framework with a tiny runtime that renders real DOM directly (no virtual DOM), uses explicit reactivity variables and gives you manual control over refs, bindings, and redraw timing.

KT.js focuses on one principle: keep direct control of the DOM and avoid unnecessary repainting.

## Reactive Contract

```ts
const user = ref({ profile: { name: 'John' }, tags: ['new'] });

console.log(user.value.profile.name); // read

user.value = {
  ...user.value,
  profile: { ...user.value.profile, name: 'Jane' },
  tags: [...user.value.tags],
}; // replace the whole outer value

user.draft.profile.name = 'Jane'; // deep write
user.draft.tags.push('active'); // array / map / set / custom-object style mutation
```

Rules:

- Read with `.value`.
- Replace the whole outer value with `.value = nextValue`.
- Use `.draft` for deep mutations on nested objects, arrays, `Map` / `Set`, or other mutable instances.
- Do not assign to `.draft` itself; mutate inside it.
- `computed` stays read-only and is consumed through `.value`.
- `oldValue` in change listeners is the previous reference only, not a deep-cloned snapshot.
- Correctness is expected to come from the transformer and TypeScript checks; runtime hot paths stay minimal on purpose.

This is an explicit contract, closer to a Rust-style model than permissive runtime magic: unclear code should fail early.

## Quick Start

```bash
pnpm create kt.js my-app
cd my-app
pnpm install
pnpm dev
```