node-mysql-audit
v1.4.1
Published
This package provides functionality for auditing database changes in MySQL.
Downloads
12
Maintainers
Readme
Database Audit Package
This package provides functionality for auditing database changes in MySQL.
Installation
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.
Usage
Importing the Package:
import { initConnection, setupDatabaseAudit } from ('node-mysql-audit');
Setting up Database Connection
initConnection();
Setting up Database Audit
const userId = 1; // Provide the user ID
const username = 'admin'; // Provide the username
setupDatabaseAudit(userId, username);
Configuration
You can configure the exceptions for auditing by editing the exceptions.json file.
Example exceptions.json
{
"exceptions": ["auditlog"]
}