# @jsonjoy.com/codegen

> No-dependencies, low-level, high-performance JIT code generation package for JavaScript

Latest version **18.30.0** (published 2026-09-08) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @jsonjoy.com/codegen
pnpm add @jsonjoy.com/codegen
yarn add @jsonjoy.com/codegen
bun add @jsonjoy.com/codegen
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 18.30.0 |
| Published | 2026-09-08 |
| First published | 2025-08-01 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10.0 |
| Dependencies | 0 |
| Unpacked size | 146.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1091 |
| Author | streamich |
| Maintainers | json-joy-team, streamich |
| Keywords | jit, codegen, code generation, dynamic, performance, javascript, compiler, function, optimization |

## Links

- npm: https://www.npmjs.com/package/@jsonjoy.com/codegen
- Repository: https://github.com/streamich/json-joy
- Homepage: https://github.com/streamich/json-joy/packages/codegen
- Issues: https://github.com/streamich/json-joy/issues
- Funding: https://github.com/sponsors/streamich
- npm.io page: https://npm.io/package/@jsonjoy.com/codegen

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 18.30.0 (latest) — 2026-09-08
- 18.28.0 — 2026-06-02
- 18.24.0 — 2026-05-15
- 18.23.0 — 2026-05-14
- 18.22.0 — 2026-05-14
- 18.21.0 — 2026-05-10
- 18.20.0 — 2026-05-09
- 18.19.0 — 2026-05-07
- 18.18.0 — 2026-05-07
- 18.17.0 — 2026-05-07
- 18.16.0 — 2026-05-06
- 18.15.0 — 2026-04-18
- 18.14.0 — 2026-04-16
- 18.13.0 — 2026-04-15
- 18.12.0 — 2026-04-12
- … 20 more at https://npm.io/package/@jsonjoy.com/codegen/versions

## README

# @jsonjoy.com/codegen

A no-dependencies, low-level, high-performance JIT code generation package for
JavaScript. This package contains utilities for generating optimized JavaScript
code at runtime. It enables creating high-performance functions by generating
code dynamically based on schemas, templates, or runtime data.

## Features

- **Zero dependencies** - Lightweight and fast to install
- **High performance** - Generates optimized JavaScript functions at runtime
- **Type safe** - Full TypeScript support with comprehensive type definitions
- **Flexible** - Supports various code generation patterns and techniques
- **Production ready** - Battle-tested and optimized for real-world usage

## Use Cases

JIT (Just-In-Time) code generation can provide significant performance improvements
when you have advance knowledge of the data structure or execution pattern.

Some examples:

- **Deep equality comparison function**: When one object is known in advance, we can
  generate an optimized function that efficiently compares against a single object.
  This technique is implemented in the `json-equal` library.

- **JSON Patch execution**: When the JSON Patch operations are known beforehand, we can
  generate an optimized function that applies the patch in the most efficient way.
  This approach is used in the `json-patch` library.

- **Schema-based validation**: Given a `json-type` schema of a JSON object, it's possible
  to generate highly optimized functions for validation and serialization that avoid
  generic overhead and execute significantly faster than traditional approaches.

Other:

- Optimized validation and serialization functions
- Custom function generation based on runtime data
- Performance-critical code that benefits from JIT compilation


## Installation

```bash
npm install @jsonjoy.com/codegen
```

## Quick Start

```typescript
import { Codegen } from '@jsonjoy.com/codegen';

const codegen = new Codegen();
// Add your code generation logic here
const optimizedFunction = codegen.compile();
```

## License

Apache-2.0

---
_Source: https://npm.io/package/@jsonjoy.com/codegen · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
