Skip to content

JSON Reporter

An Emigrate reporter that outputs a JSON object.

The reporter is included by default and does not need to be installed separately.

Usage

Via CLI

Terminal window
npx emigrate <command> --reporter json

See for instance the Reporter Option for the up command for more information.

Via configuration file

emigrate.config.js
/** @type {import('@emigrate/cli').EmigrateConfig} */
export default {
reporter: 'json',
};

See Reporter Configuration for more information.

Example output

{
"command": "up",
"version": "0.17.2",
"numberTotalMigrations": 1,
"numberDoneMigrations": 0,
"numberSkippedMigrations": 0,
"numberFailedMigrations": 0,
"numberPendingMigrations": 1,
"success": true,
"startTime": 1707206599968,
"endTime": 1707206600005,
"migrations": [
{
"name": "/your/project/migrations/20240206075446123_some_other_table.sql",
"status": "pending",
"duration": 0
}
]
}