{"id":48734,"library":"node-baseline","title":"Baseline","description":"A simple database migration and versioning tool for Node.js, focusing on MySQL databases. Version 0.2.7 (stable, last updated 2015) works by maintaining change logs in the database and incrementally updating the database using user-supplied SQL change scripts. It supports init, migrate, backup, and restore commands via CLI. Only MySQL is supported currently, with planned support for other databases. Requires Node.js >= 4.0.0. Configuration files support YAML, JSON, and Node module formats. The tool is minimal and aimed at database-first development teams.","status":"maintenance","version":"0.2.7","language":"javascript","source_language":"en","source_url":"https://github.com/nn1900/baseline","tags":["javascript","database","migration","versioning"],"install":[{"cmd":"npm install node-baseline","lang":"bash","label":"npm"},{"cmd":"yarn add node-baseline","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-baseline","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"MySQL database driver for database connections","package":"mysql","optional":false},{"reason":"Parsing YAML configuration files","package":"yamljs","optional":true}],"imports":[{"note":"The package is primarily a CLI tool, installed globally or via npx.","wrong":"npm install node-baseline --save-dev && node node_modules/.bin/baseline","symbol":"baseline (CLI)","correct":"npm install -g node-baseline && baseline --help"},{"note":"Configuration can be any of YAML, JSON, or a Node module exporting an object. Use --config to specify a custom path.","wrong":"Create a config file named '.baselinerc.json' but with wrong format","symbol":".baselinerc configuration","correct":"Create a .baselinerc file (YAML/JSON/JS) in project root"},{"note":"The --database flag is used to target a specific database from the configuration; --force reinitializes if baseline exists.","wrong":"baseline init --database test --force","symbol":"baseline init","correct":"baseline init --config /path/to/.baselinerc"}],"quickstart":{"code":"npm install -g node-baseline\n\n# Create a configuration file .baselinerc.yaml:\ndatabases:\n  test:\n    host: localhost\n    port: 3306\n    user: root\n    password: ''\n    database: test\nrootPath: ./db\n\n# Initialize baseline for the database:\nbaseline init --config .baselinerc.yaml\n\n# Create a change script in ./db/test/changes/v01.01.sql:\n# ALTER TABLE users ADD COLUMN age INT;\n\n# Apply the migration:\nbaseline up --config .baselinerc.yaml\n\n# Backup the database:\nbaseline backup --config .baselinerc.yaml --output ./backups","lang":"javascript","description":"Initialize a MySQL database with baseline, create a migration script, and apply it."},"warnings":[{"fix":"Upgrade Node.js to version 4.0.0 or higher.","message":"Node.js version must be >= 4.0.0. Lower versions are not supported.","severity":"breaking","affected_versions":"<0.2.7"},{"fix":"Use a different migration tool for non-MySQL databases (e.g., Knex, Sequelize).","message":"Only MySQL is supported. Other databases will not work.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"If installed locally, run `npx baseline <command>`.","message":"Baseline uses a global install (`-g`). Local install requires `npx baseline` or full path to binary.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Consider using actively maintained migration tools like node-pg-migrate, Umzug, or Flyway.","message":"The package has not been updated since 2015 and may have security vulnerabilities in its dependencies.","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.2.7':16 '2015':20 '4.0.0':64 'aim':79 'backup':45 'baselin':1 'chang':24,39 'cli':50 'command':48 'configur':65 'current':55 'databas':4,14,28,33,61,82,87 'database-first':81 'develop':84 'file':66 'first':83 'focus':11 'format':73 'increment':30 'init':43 'javascript':86 'json':69 'last':18 'log':25 'maintain':23 'migrat':5,44,88 'minim':77 'modul':72 'mysql':13,52 'node':71 'node.js':10,63 'plan':57 'requir':62 'restor':47 'script':40 'simpl':3 'sql':38 'stabl':17 'suppli':37 'support':42,54,58,67 'team':85 'tool':8,75 'updat':19,31 'use':34 'user':36 'user-suppli':35 'version':7,15,89 'via':49 'work':21 'yaml':68","created_at":"2026-06-07T16:58:11.791607+00:00","updated_at":"2026-06-07T16:58:11.791607+00:00","problems":[{"fix":"Create a .baselinerc file (YAML/JSON/JS) in the working directory or use --config with a correct path.","cause":"Missing .baselinerc file or --config flag pointing to non-existent file.","error":"Error: Database configuration not found. Please provide a valid config file."},{"fix":"Start MySQL server or update the configuration with correct host/port.","cause":"MySQL server not running or not accessible at the configured host/port.","error":"Error: connect ECONNREFUSED 127.0.0.1:3306"},{"fix":"Add password field to the database configuration or provide correct credentials.","cause":"No password provided or incorrect credentials.","error":"Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost' (using password: NO)"}],"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/nn1900/baseline#readme","github":"https://github.com/nn1900/baseline","docs":null,"changelog":null,"pypi":null,"npm":"node-baseline","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-07","next_check":"2026-09-05","install_tag":null}}