This package provides functionality for auditing database changes in MySQL.
To install the package, run the following command:
npm install node-mysql-audit
Upon installation, a configuration file will be generated in your project directory. This file includes essential information for database connections and an exceptions array. Before utilizing the audit function, ensure that these configurations are properly defined.
Importing the Package:
import { initConnection, setupDatabaseAudit } from ('node-mysql-audit');
initConnection();
const userId = 1; // Provide the user ID
const username = 'admin'; // Provide the username
setupDatabaseAudit(userId, username);
You can configure the exceptions for auditing by editing the exceptions.json file.
Example exceptions.json
{
"exceptions": ["auditlog"]
}