{"id":42722,"library":"exodusjs","title":"exodusjs","description":"exodusjs is a simple PostgreSQL database migration tool for Node.js. Version 2.1.1 is stable, with infrequent releases. It provides a CLI for creating, migrating, and rolling back migrations, tracking applied migrations in a dedicated database table. Unlike more feature-rich tools like node-pg-migrate or db-migrate, exodusjs focuses on minimalism: migrations are plain SQL in JavaScript modules with only 'up' and 'down' exported. No schema management, no seeding, no TypeScript support. Requires a DATABASE_URL environment variable and a local postgres connection.","status":"maintenance","version":"2.1.1","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/swlkr/exodusjs","tags":["javascript","exodus","exodusjs","migration","database","postgres","nodejs"],"install":[{"cmd":"npm install exodusjs","lang":"bash","label":"npm"},{"cmd":"yarn add exodusjs","lang":"bash","label":"yarn"},{"cmd":"pnpm add exodusjs","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"PostgreSQL client used to run migrations directly via node-postgres","package":"pg","optional":false}],"imports":[{"note":"Migration files use CommonJS module.exports. ES module syntax is not supported.","wrong":"export default { up, down }","symbol":"migration (from migration file)","correct":"module.exports = { up: 'SQL...', down: 'SQL...' }"},{"note":"Install locally with --save-dev and use npx to run the CLI.","wrong":"exodus migrate (without npx if not globally installed)","symbol":"exodus CLI","correct":"npx exodus migrate"},{"note":"The CLI reads DATABASE_URL from the environment. Must be a valid PostgreSQL connection string.","wrong":"hardcoded connection string","symbol":"DATABASE_URL (environment variable)","correct":"process.env.DATABASE_URL"}],"quickstart":{"code":"// Install exodusjs as a dev dependency\n// npm i -D exodusjs\n\n// Set up database URL\n// export DATABASE_URL=postgres://user:password@localhost:5432/mydb\n\n// Create a migration\n// npx exodus create create-users-table\n\n// This generates migrations/20250210120001-create-users-table.js with template\n\n// Edit the migration file:\nvar migration = {\n  up: `\n    create table users (\n      id serial primary key,\n      name text not null\n    );\n  `,\n  down: `\n    drop table users;\n  `\n};\nmodule.exports = migration;\n\n// Run migrations\n// npx exodus migrate\n\n// Rollback if needed\n// npx exodus rollback","lang":"javascript","description":"Shows the full workflow: install, create a migration file, run it against PostgreSQL, and rollback."},"warnings":[{"fix":"Use the CLI's 'create' command which auto-generates a timestamp prefix.","message":"Migrations are executed in alphabetical order by filename. Ensure timestamps are formatted correctly (e.g., YYYYMMDDHHMMSS) to maintain order.","severity":"gotcha","affected_versions":"*"},{"fix":"Run 'npm install pg' alongside exodusjs.","message":"exodusjs requires node-postgres (pg) as a peer dependency. It does not bundle it.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Always test your SQL against the database before running 'exodus migrate'.","message":"The CLI has no built-in validation for SQL syntax. A migration with invalid SQL will fail at runtime.","severity":"deprecated","affected_versions":"*"}],"env_vars":null,"search_vec":"'2.1.1':13 'appli':31 'back':28 'cli':22 'connect':88 'creat':24 'databas':7,36,80,93 'db':51 'db-migrat':50 'dedic':35 'environ':82 'exodus':90 'exodusj':1,2,53,91 'export':69 'featur':41 'feature-rich':40 'focus':54 'infrequ':17 'javascript':62,89 'like':44 'local':86 'manag':72 'migrat':8,25,29,32,48,52,57,92 'minim':56 'modul':63 'node':46 'node-pg-migr':45 'node.js':11 'nodej':95 'pg':47 'plain':59 'postgr':87,94 'postgresql':6 'provid':20 'releas':18 'requir':78 'rich':42 'roll':27 'schema':71 'seed':74 'simpl':5 'sql':60 'stabl':15 'support':77 'tabl':37 'tool':9,43 'track':30 'typescript':76 'unlik':38 'url':81 'variabl':83 'version':12","created_at":"2026-06-05T16:56:21.036353+00:00","updated_at":"2026-06-05T16:56:21.036353+00:00","problems":[{"fix":"npm install pg --save-dev","cause":"Missing peer dependency pg","error":"Error: Cannot find module 'pg'"},{"fix":"Verify PostgreSQL is running and DATABASE_URL env var is correct.","cause":"PostgreSQL server not running or DATABASE_URL incorrect","error":"Error: connect ECONNREFUSED 127.0.0.1:5432"},{"fix":"If you manually dropped the table, re-run 'exodus migrate' to recreate it. Or check if migrations have already been applied.","cause":"exodusjs creates the migrations table on first run; subsequent runs expect it","error":"[EXODUS] Table \"migrations\" already exists when running migrate twice"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/swlkr/exodusjs#readme","github":"ssh://git@github.com/swlkr/exodusjs","docs":null,"changelog":null,"pypi":null,"npm":"exodusjs","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}