Skip to content

Instantly share code, notes, and snippets.

View danielomiya's full-sized avatar
🏠
Working from home

Daniel Omiya danielomiya

🏠
Working from home
View GitHub Profile
@danielomiya
danielomiya / mysql-async-example.js
Created November 2, 2020 02:37
Simple example of wrapping mysql functionalities on Promises and calling them with async/await interfaces.
// conn.js
const mysql = require('mysql');
exports.openConnectionAsync = function openConnectionAsync() {
const conn = mysql.createConnection({
// ... config
});
return new Promise((resolve, reject) => {