# jiti — card for AI agents

Runtime TypeScript and ESM support for Node.js without build steps.

Category: Languages, types and runtimes · npm package `jiti` · latest version 2.7.0 (checked 2026-11-01)
Install: `npm install jiti`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## jiti
- In ESM, create instances with `createJiti(import.meta.url)`. The README labels the CommonJS `require("jiti")` setup deprecated.
- Load modules with `await jiti.import(id)`. The sync `jiti(id)` call is marked deprecated.
- To get a default export, call `jiti.import(id, { default: true })` instead of writing `mod?.default ?? mod`.
- Leave `fsCache` enabled. The README recommends it for better performance.
- On performance-critical hot paths that read module exports very frequently, set `interopDefault: false` or `JITI_INTEROP_DEFAULT=false`.
- Only use `jiti/register` or `node --import jiti/register` on Node.js > 20.
- If the project relies on tsconfig `paths`, set the opt-in `tsconfigPaths: true`. To import an edited module again, set `moduleCache: false`.

## What it is
- jiti describes itself as "Runtime TypeScript and ESM support for Node.js". The GitHub repository was created on 2020-06-06 and is MIT licensed.
- In code, you create an instance with `createJiti(import.meta.url)` and load files through that instance. The README still shows a CommonJS setup with `require("jiti")` and `createJiti(__filename)`, but it labels that path deprecated.
- The latest release is v2.7.0, published 2026-05-05. Its first listed enhancement is support for explicit resource management with `using` and `await using`.

## Caveats
- The require()-style API is deprecated: The synchronous `jiti(id)` call, the README's stand-in for `require(id)`, appears under the heading "CommonJS (sync &amp; deprecated)".
- Every import is wrapped in a Proxy: `interopDefault` is on by default. The README warns that it wraps all imported modules in a Proxy, which adds "~25-50ns overhead per property access". For hot paths it suggests `interopDefault: false`.
- Behavior shifted between 2.0 and 2.1: jiti 2.1 turned `interopDefault` on through a new Proxy method. The maintainers warn that this may change behavior for anyone who moved to 2.0.0 earlier.
- Global loader needs Node.js > 20: `jiti/register` works through Node's global module hooks. The README marks it "Important: Requires Node.js > 20".
- tsconfig paths are ignored by default: Resolution of TypeScript `paths` is the `tsconfigPaths` option, and it defaults to `false`. Set it to `true` to auto-discover `tsconfig.json`, or pass a string with an explicit path.

## Numbers (AgentGid data)
- Gid Score: 67.3 (#526 of all tools, 13 of 70 in its category)
- Used in 110 public projects set up for AI coding agents (1.8%)
- Downloads last week: 268,628,511 (as of 2026-11-24), +34.4% over 4 weeks
- GitHub stars: 2,987 (as of 2026-11-24)
- Last push: 2026-11-23

## Often used with
Vitest 80.9%, tsx 58.2%, jsdom 48.2%, Nx 40.9%, TypeScript 95.5%, Nx JS Plugin 39.1%

## Checked alternatives (same job)
- tsx: https://agentgid.com/tools/tsx/agent.md
- ts-node: https://agentgid.com/tools/ts-node/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/jiti/
- Homepage: https://github.com/unjs/jiti#readme
- Repository: https://github.com/unjs/jiti
- Source: https://github.com/unjs/jiti#readme
- Source: https://github.com/unjs/jiti
- Source: https://github.com/unjs/jiti/releases


## jiti: run TypeScript files in Node.js without a build

jiti is a small free JavaScript package that lets a Node.js program open TypeScript files directly, with no build step first. Tools use it to read settings files such as eslint.config.ts or tailwind.config.ts. It only runs the code; it does not check your types.

### Where to use it
- Read a TypeScript settings file: Your own build script or command-line helper lets people write its settings in a .ts file and still loads them from plain JavaScript.
- Run a one-off TypeScript script: Your assistant writes a small seed or cleanup script in TypeScript and runs it right away, without setting up a compiler.
- Let ESLint read eslint.config.ts: You want your lint settings in TypeScript; on Node.js, ESLint needs jiti installed in the project to open that file.
- Pick up edits without a restart: A dev server reloads a settings file after the person saves it, instead of keeping the first version it read.
- Mix old and new style packages: Your script uses packages written in the older require style and newer import style; jiti lets them load each other.
- Short import paths from tsconfig: Your code imports with shortcuts like ~/lib from tsconfig.json; jiti can follow them when you turn that option on.

### How to start
- Run any TypeScript file once from the terminal.

```
npx jiti ./index.ts
```

- Inside your own code, make one jiti instance and import .ts files through it.

```
import { createJiti } from "jiti";
const jiti = createJiti(import.meta.url);
const mod = await jiti.import("./path/to/file.ts");
```

- Or register it once so plain node can start a .ts file (Node.js newer than 20).

```
node --import jiti/register index.ts
```


### License
Free to use in paid and closed products under the MIT license. Keep the license notice when you ship jiti's own files.

### Good to know
- It does not check types. In our run a file with a wrong type still ran; keep the TypeScript compiler for checks.
- It keeps a cache of converted files on disk, in node_modules/.cache/jiti or the system temp folder.
- Version 2 changed how default exports are merged; code written for version 1 may behave differently.
- The project is alive; the latest release, 2.7.0, came out on 5 May 2026.
- Newer Node.js can run simple .ts files alone, but it ignores tsconfig.json and path shortcuts, and in our run it refused an enum.

Checked 2026-11-11 against: https://github.com/unjs/jiti/blob/main/README.md, https://github.com/unjs/jiti/blob/main/LICENSE, https://github.com/unjs/jiti/blob/v1/README.md, https://registry.npmjs.org/jiti, https://registry.npmjs.org/jiti/2.7.0, https://eslint.org/docs/latest/use/configure/configuration-files, https://nodejs.org/api/typescript.html

### Mistakes to avoid
- Don't: const jiti = require("jiti")(__filename);  (the version 1 way) → Do: import { createJiti } from "jiti"; const jiti = createJiti(import.meta.url); (Version 2 exports createJiti; the call-the-module form is from the v1 docs.)
- Don't: const mod = jiti("./file.ts")  (synchronous load) → Do: const mod = await jiti.import("./file.ts") (The synchronous require-style call is marked deprecated in the README.)
- Don't: const config = await jiti.import("./config.ts"); config.name  (reading the module, not its default export) → Do: const config = await jiti.import("./config.ts", { default: true }) (jiti.import returns the whole module like import(); the default option returns the default export.)
- Don't: Importing the same .ts file again after it changed and expecting new values → Do: Create the instance with { moduleCache: false } for files that change while the program runs (The module cache is on by default; in our run the cached instance kept returning 1 after the file said 2.)
- Don't: Treating a successful jiti run as proof the types are right → Do: Run tsc --noEmit (TypeScript) in CI as a separate check (jiti only converts and runs; our file with a number set to a string ran without an error.)

### Questions
- Does jiti check my TypeScript types? No. It turns the file into JavaScript and runs it; a file with a type error still ran in our test. Use tsc for checks.
- Is the synchronous jiti() call still supported? It still exists for CommonJS code, but the README marks it as deprecated; use await jiti.import() instead.
- Which tools use it? The README lists Nuxt, Tailwindcss, ESLint, Docusaurus, Storybook and others.
- Can it load JSX files? Yes, but only when you turn the jsx option on.
- Where are the old version 1 docs? On the v1 branch of the project; the main branch is version 2.

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
