Registry / devops / ts-migrate-server

ts-migrate-server

JSON →
library0.1.33jsnpmunverified

A package from Airbnb that contains the main migration runner for ts-migrate, a tool to assist migrating JavaScript codebases to TypeScript. It spawns a TypeScript server (TSServer) process and provides a standardized API for running migration plugins. Current stable version is 0.1.33. The tool is designed around Airbnb projects and is considered experimental for broader use. It requires TypeScript >4.0 and is part of the ts-migrate monorepo which also includes plugins and a CLI. Unlike simple codemods, ts-migrate-server leverages the TypeScript compiler API for more complex transformations.

npm install ts-migrate-server
INSTALL
IMPORT
SIG · TS-MIGRATE-SERVER
T
ts-migrate-server
devopsjavascriptv0.1.33
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

migrate
import { migrate } from 'ts-migrate-server'
const migrate = require('ts-migrate-server').migrate
Package is ESM-only; named export.
MigrateConfig
import { MigrateConfig } from 'ts-migrate-server'
import MigrateConfig from 'ts-migrate-server'
Named export, not default. Used to configure migration options.
Migration
import { Migration } from 'ts-migrate-server'
const Migration = require('ts-migrate-server').Migration
Named export; also a type, so you can import type via 'import type { Migration } from 'ts-migrate-server''.

Basic example showing how to import migrate and MigrateConfig, configure input directory, and run migration asynchronously.

import path from 'path'; import { migrate, MigrateConfig } from 'ts-migrate-server'; async function runMigration() { const inputDir = path.resolve(__dirname, 'input'); const config = new MigrateConfig(); const exitCode = await migrate({ rootDir: inputDir, config }); process.exit(exitCode); } runMigration();
Debug
Known issues
gotchats-migrate-server is designed around Airbnb projects; use at your own risk for other projects.
fix
Thoroughly test migrations on your codebase and customize plugins as needed.
affects: all
deprecatedPackage is in maintenance mode; ts-migrate is not actively developed and may not support newer TypeScript versions beyond 4.x.
fix
Consider alternative migration tools like ts-morph or typewiz for active support.
affects: >=0.1.33
gotchaRequires TypeScript peer dependency >4.0; not compatible with TypeScript 5.x or later.
fix
Keep TypeScript version at 4.x or check for updated releases.
affects: <0.2.0
gotchaPackage does not provide type definitions; you may need to install @types/ts-migrate-server separately.
fix
Run 'npm install --save-dev @types/ts-migrate-server' if available, or use a declaration file.
affects: all
gotchaThe migrate function spawns a TSServer process; ensure your environment has Node.js and TypeScript installed.
fix
Install Node.js 12+ and TypeScript peer dependency before use.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'ts-migrate-server'
Package not installed or not in node_modules.
fix
Run 'npm install --save-dev ts-migrate-server' or 'yarn add --dev ts-migrate-server'.
TypeError: migrate is not a function
Incorrect import style (e.g., default import instead of named import).
fix
Use named import: import { migrate } from 'ts-migrate-server'.
MigrateConfig is not a constructor
Class is exported as named, not default; likely imported incorrectly.
fix
Use: import { MigrateConfig } from 'ts-migrate-server'.
TypeError: ts-migrate-server requires TypeScript >4.0
Installed TypeScript version is incompatible.
fix
Check TypeScript version with 'npx tsc --version' and upgrade to >4.0.
Upgrade
Version history
0.1.33latest on npm
Audit
Dependencies
typescriptrequiredRequired peer dependency for TypeScript integration and migration
Agent activity
8 hits · last 30 days
node
8
Resources
ts-migrate-server — npm install ts-migrate-server · libregistry