Comparing version 0.0.2 to 0.0.3
22
index.js
@@ -62,6 +62,10 @@ const mysql = require('mysql'); | ||
let timeout = () => { | ||
setTimeout(() => { | ||
this.connect() | ||
.then(() => this.emit("connect")) | ||
.catch((err) => this.emit("error", "Lol"), timeout()); | ||
setTimeout(async () => { | ||
try { | ||
await this.connect(); | ||
this.emit("connect"); | ||
} catch (err) { | ||
this.emit("error", err); | ||
timeout(); | ||
} | ||
}, 1000); | ||
@@ -94,4 +98,4 @@ }; | ||
async connect() { | ||
return await new Promise((resolve, reject) => { | ||
connect() { | ||
return new Promise((resolve, reject) => { | ||
this.connection.connect((err) => { | ||
@@ -105,6 +109,6 @@ if (err) | ||
async query(str, params, callback = false) { | ||
if (typeof params == "function") | ||
query(str, params, callback = false) { | ||
if (typeof params === "function") | ||
callback = params, params = false; | ||
return await _try(async () => { | ||
return _try(async () => { | ||
return await new Promise((resolve, reject) => { | ||
@@ -111,0 +115,0 @@ this.connection.query(str, params, async (err, result, fields) => { |
{ | ||
"name": "amysql", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Useless wrapper over mysql", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,0 +0,0 @@ # node-amysql |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
Possible typosquat attack
Supply chain riskThere is a package with a similar name that is downloaded much more often.
Did you mean |
---|
alasql |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
23668
10
247
0