Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

jiti

Run TypeScript files in Node.js without a build.

Languages, types and runtimesNPM

GitHubWebsite

1. License

“Permission is hereby granted, free of charge, to any person obtaining a copy”

MIT allows use in paid and closed-source products.

github.com/unjs/jiti/blob/main/LICENSE

From the package registry and GitHub, checked daily; card checked Nov 11, 2026. Tap a verdict to see its source.How we checkedReport an error

What jiti does

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.

What people build with 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.

jiti popularity

67 / 100
Gid Score, #526 overall
269M
downloads a week, npm
2,987
GitHub stars
110
agent projects use it
jiti: downloads per weeknpm, jiti 268,628,511
jiti: GitHub starsunjs/jiti 2,987

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How jiti is used

  • jiti is a dependency in 110 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (2.3% of the 4,867 JavaScript/TypeScript ones), #4 of 70 in languages, types and runtimes.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 178; those are left out of every share on this page.
  • The most used alternative in our scan is tsx (953 projects).
  • Projects that use it most often also use Vitest (80.9%), tsx (58.2%), jsdom (48.2%).
  • It is more common in projects set up for OpenClaw (9.9%) than for GitHub Copilot (1.6%).

By coding agent

69 projects, 2.1%
49 projects, 1.6%
38 projects, 1.6%
33 projects, 9.9%
29 projects, 6.1%
16 projects, 3.4%
8 projects, 2.3%
6 projects, 4.3%

Often used with

In 80.9% of its projects
In 58.2% of its projects
In 48.2% of its projects
In 40.9% of its projects
In 95.5% of its projects
In 39.1% of its projects
In 37.3% of its projects
In 37.3% of its projects

jiti in practice

Strengths

Mirrors import() and import.meta.resolve()

The README pairs each call with its native counterpart. <code>jiti.import(id)</code> works like <code>import(id)</code>, and <code>jiti.esmResolve(id)</code> works like <code>import.meta.resolve(id)</code>.

Default export in one option

Passing <code>{ default: true }</code> to <code>jiti.import()</code> returns <code>mod?.default ?? mod</code>, so you do not have to write that fallback yourself.

No dependencies, fewer transforms

The README calls jiti "super slim and zero dependency". It also says syntax detection lets jiti skip transforms that a file does not need.

Transpiled files cached on disk

<code>fsCache</code> is on by default. It writes to <code>node_modules/.cache/jiti</code> if that folder exists, and to <code>{TMP_DIR}/jiti</code> if it does not.

Watch out for

The require()-style API is deprecated

The synchronous <code>jiti(id)</code> call, the README's stand-in for <code>require(id)</code>, appears under the heading "CommonJS (sync &amp;amp; deprecated)".

Every import is wrapped in a Proxy

<code>interopDefault</code> 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 <code>interopDefault: false</code>.

Behavior shifted between 2.0 and 2.1

jiti 2.1 turned <code>interopDefault</code> on through a new Proxy method. The maintainers warn that this may change behavior for anyone who moved to 2.0.0 earlier.

Import a TypeScript file from ESM

import { createJiti } from "jiti";

const jiti = createJiti(import.meta.url);

// jiti.import(id) is similar to import(id)
const mod = await jiti.import("./path/to/file.ts");

// jiti.esmResolve(id) is similar to import.meta.resolve(id)
const resolvedPath = jiti.esmResolve("./src");

// shortcut to mod?.default ?? mod
const modDefault = await jiti.import("./path/to/file.ts", { default: true });

More about jiti

Head to head
Packages around it
  • vitest: Test runner
  • jsdom: DOM implementation for Node
  • tsx: TypeScript script runner
  • nx: Monorepo build system
  • @nx/js: Nx JavaScript plugin
  • vite: Dev server and bundler
More in Languages, types and runtimes

Alternatives

jiti This page

MITGid 67269M/wk

tsx

Pick tsx when you mainly run TypeScript scripts and servers from the terminal; it runs them with esbuild.

MITGid 84146M/wk

ts-node

Pick ts-node when you want a TypeScript runner with source map support.

MITGid 8162.2M/wk

Bun

Pick Bun when you can switch the whole project to another JavaScript runtime that runs TypeScript itself.

Compare jiti with another tool

Get started

Tell your AI assistant

“Add jiti 2.7.0 as a dev dependency and load our settings file src/site.config.ts with createJiti(import.meta.url) and await jiti.import(path, { default: true }); keep type checking in tsc.”

  1. Run any TypeScript file once from the terminal.

    npx jiti ./index.ts

    From github.com/unjs/jiti/blob/main/README.md

  2. 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");
    

    From github.com/unjs/jiti/blob/main/README.md

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

    node --import jiti/register index.ts

    From github.com/unjs/jiti/blob/main/README.md

Rules for your agent

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`.

Mistakes to avoid

const jiti = require("jiti")(__filename); (the version 1 way)
import { createJiti } from "jiti"; const jiti = createJiti(import.meta.url);

Version 2 exports createJiti; the call-the-module form is from the v1 docs.

const mod = jiti("./file.ts") (synchronous load)
const mod = await jiti.import("./file.ts")

The synchronous require-style call is marked deprecated in the README.

const config = await jiti.import("./config.ts"); config.name (reading the module, not its default export)
const config = await jiti.import("./config.ts", { default: true })

jiti.import returns the whole module like import(); the default option returns the default export.

Importing the same .ts file again after it changed and expecting new values
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.

Treating a successful jiti run as proof the types are right
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.