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
npx emigrate <command> --reporter jsonpnpm emigrate <command> --reporter jsonyarn emigrate <command> --reporter jsonbunx --bun emigrate <command> --reporter json{ "scripts": { "emigrate": "emigrate" }}deno task emigrate <command> --reporter jsonSee for instance the Reporter Option for the up command for more information.
Via configuration file
/** @type {import('@emigrate/cli').EmigrateConfig} */export default { reporter: 'json',};import { type EmigrateConfig } from '@emigrate/cli';
const config: EmigrateConfig = { reporter: 'json',};
export default config;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 } ]}