Δ
Open Source · Language Agnostic · TypeScript

Transform code.
Any language.

Delta is a universal code transformation language.
Write readable, composable transforms that work across
TypeScript, Python, Go, Rust, Java, and more.

$ npm install -g @delta-lang/cli

One file. Your whole codebase, transformed.

Write the transform once. Delta handles the rest — finding, validating, and applying changes across every matching file.

transform.delta
// Upgrade null checks across all TypeScript files
fix strictNull {
  pattern:  { $X == null }
  replace:  { $X === null }
  scope:    "**/*.ts"
  severity: bug
  note:     "Use strict equality"
}

apply fix strictNull to project preview
delta run output
Guard passed — no raw SQL in 47 files
23 files scanned
- if (user == null) return;
+ if (user === null) return;
- if (data.token == null) throw;
+ if (data.token === null) throw;
61 changes across 23 files
Preview mode — no files written
transform.delta
// Surgically replace one function in one file
patch "src/auth/hash.ts" in TypeScript {
  find fn hashPassword() {}
  replace with {
    return await bcrypt.hash(password, 12);
  }
  why: "upgrade to async bcrypt"
}
delta run output
Located hashPassword in src/auth/hash.ts:14
- return md5(password);
+ return await bcrypt.hash(password, 12);
1 file patched
📝 Reason: upgrade to async bcrypt
transform.delta
// Migrate lodash to native array methods
migrate "lodash to native" in TypeScript {
  rename: _.map    -> Array.prototype.map
  rename: _.filter -> Array.prototype.filter
  rename: _.find   -> Array.prototype.find
  remove: deprecated _.each
  scope:  "src/**/*.ts"
}
apply migrate "lodash to native" to project
delta run output
Scanning 34 TypeScript files
- const names = _.map(users, u => u.name);
+ const names = users.map(u => u.name);
- const active = _.filter(users, u => u.active);
+ const active = users.filter(u => u.active);
47 renames across 34 files
12 deprecated calls removed
transform.delta
// Assert invariants before transforms run
guard "no raw SQL" {
  scope:   "src/**"
  assert:  no file contains raw SQL interpolation
  on_fail: block_apply, show_diff
}

guard "api contract" {
  scope:   "src/**"
  assert:  fn verifyToken() exists
  assert:  fn hashPassword() exists
  on_fail: block_apply
}
delta run output
Guard "no raw SQL" — passed (47 files)
Guard "api contract" — passed
verifyToken found at src/auth/jwt.ts:8
hashPassword found at src/auth/hash.ts:14
All guards passed — proceeding with transforms
transform.delta
// Track where user input flows through the codebase
trace userInput in "src/" {
  language: TypeScript
  origin:   req.body.email
  follow:   assignments, function_calls, returns
  report:   full_chain
  flag:     "any path reaching db.query without sanitize"
  flag:     "any path reaching console.log"
}
delta run output
Tracing req.body.email through 23 files
FLAG: email → validateUser → db.query (no sanitize)
routes/auth.ts:12 services/user.ts:34 db/query.ts:8
FLAG: email → logger.debug (exposed in log)
middleware/log.ts:22
2 paths flagged — full chain report saved

Six constructs. Infinite transforms.

Every transformation maps to one of six composable keywords. Learn them once, use them everywhere.

Works where your code lives.

Stable
TypeScript JavaScript Python Go Rust
Beta
Java Kotlin Swift Ruby C++ C# PHP

Stable languages use the TypeScript Compiler API or tree-sitter for AST-accurate transforms. Beta languages use the generic tree-sitter adapter.

Don't write transforms from scratch.

The community fix library has ready-to-run transforms for the most common patterns — null checks, async modernisation, security fixes, API migrations, and more.

TS null-checks.delta bug
TS async-modernisation.delta style
🔒 sql-injection.delta security
🔒 hardcoded-secrets.delta security
PY f-string-migration.delta style
GO error-handling.delta bug
TS performance.delta perf
react-18.delta migrate
next-14.delta migrate

Up and running in 60 seconds.

1

Install

npm install -g @delta-lang/cli
2

Create a transform

delta init

Scaffolds a transform.delta in your project root.

3

Preview & apply

delta run transform.delta --preview
delta run transform.delta