Skip to content

JavaScript Template

A default template plugin that can generate JavaScript or TypeScript migration files (in either ESM or CommonJS format).

Installation

The JavaScript template plugin is built-in and does not need to be installed separately.

Usage

To generate a new migration file with the default JavaScript template and the .js file extension use the new command:

Terminal window
npx emigrate new create some fancy table

You can use the --extension option to specify a different file extension for the migration file, e.g. emigrate new --extension .cjs create some table.

For more information see the new command’s documentation.