MySQL dump through nodejs checking status

I am using this code to dump or backup the database. the below code is working very perfectly but I don’t know how I make sure this execution or dump has been completed or not.

how I get the callback response in success or error after completion or incomplete with async and await method.

NPM and documentation: $ npm install mysqldump

const result = mysqldump({
	connection: {
		host: "localhost",
		user: "username",
		password: "password",
		database: "database",
	dumpToFile: "./dump.sql.gz",
	compressFile: true,

If the code generates an error in its assertions, it will throw an exception of type Error. So you can try-catch (or nested try-catch for a success check, I suppose).

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.