A pure JavaScript MySQL binlog listener for Node.js, allowing real-time capture of row-level changes (INSERT, UPDATE, DELETE) from MySQL binary logs. Current stable version is 0.5.x, with irregular releases. Works with MySQL 5.5–5.7, enabling row-format binlog. Requires explicit binlog configuration and replication privileges. A key differentiator is its pure JS implementation (no native dependencies) via the mysql package, but it has limited maintenance and no support for MySQL 8+ binlog features.
npm install zongjiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Instantiates a ZongJi listener, starts capturing row insert events, outputs rows, stops after 10 seconds.
Upgrade Node.js to v8+ or use ZongJi v0.4.7.
Use MySQL 5.7 or lower, or switch to a maintained alternative like @rodrigogs/mysql-events.
Use 'binlog' event and check evt.getEventName().
Disable binlog_checksum or understand that ZongJi won't detect corruption.
Call connection.end() or pool.end() after zongji.stop().
Always specify includeEvents with row events: ['writerows','updaterows','deleterows'].
Run: GRANT REPLICATION SLAVE, REPLICATION CLIENT, SELECT ON *.* TO 'user'@'host';
Check MySQL is running and verify host/port in ZongJi constructor.
Run: npm install zongji
Set binlog_format = ROW in my.cnf and restart MySQL.