Skip to content

TypeScript and Modern JavaScript Support

TypeScript and modern JavaScript are supported out of the box via jiti.

Usage

You can add a script to your package.json:

jsonc
{
  "scripts": {
    // ..
    "migrate": "node-pg-migrate", 
  },
}

TypeScript and JavaScript migration files are picked up automatically. When creating a new migration, choose TypeScript with -j ts/--migration-file-language ts (only valid on the create command):

bash
npm run migrate create my-migration -j ts

Now you can run migrations with:

bash
npm run migrate
bash
pnpm run migrate
bash
yarn migrate
bash
bun run migrate