Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

async-mysql

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-mysql - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

.eslintrc

30

gulpfile.js

@@ -5,6 +5,20 @@ 'use strict';

sourcemaps = require('gulp-sourcemaps'),
babel = require('gulp-babel');
babel = require('gulp-babel'),
eslint = require('gulp-eslint'),
mocha = require('gulp-mocha');
gulp.task('default', function () {
require('babel/register')({
experimental: true
});
gulp.task('lint', function () {
return gulp
.src(['./src/**/*.js', './src/tests/**/*.js'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failOnError());
});
gulp.task('bundle', ['lint'], function () {
return gulp
.src('src/main.js')

@@ -20,4 +34,14 @@ .pipe(sourcemaps.init())

gulp.task('test', ['bundle'], function () {
return gulp
.src('./tests/*.js', {
read: false
})
.pipe(mocha());
});
gulp.task('default', ['test']);
gulp.task('watch', function () {
gulp.watch('src/**/*', ['default']);
gulp.watch(['src/**/*', 'tests/**/*'], ['default']);
});
{
"name": "async-mysql",
"description": "async-mysql is a wrapper for mysql that uses ES7 async functions.",
"version": "1.0.0",
"version": "1.0.1",
"main": "src/main.js",

@@ -22,10 +22,17 @@ "author": {

"devDependencies": {
"babel": "^4.7.16",
"babel-eslint": "^2.0.2",
"babel-runtime": "^4.7.16",
"chai": "^2.1.2",
"gulp": "^3.8.11",
"gulp-babel": "^4.0.0",
"gulp-sourcemaps": "^1.5.1"
"gulp-eslint": "^0.7.0",
"gulp-mocha": "^2.0.0",
"gulp-sourcemaps": "^1.5.1",
"mocha": "^2.2.1"
},
"dependencies": {
"bluebird": "^2.9.14",
"mysql": "^2.5.5"
}
}

37

README.md
# async-mysql
async-mysql is a wrapper for [mysql](https://www.npmjs.com/package/mysql) that uses ES7 async functions.
[![NPM version](http://img.shields.io/npm/v/async-mysql.svg?style=flat)](https://www.npmjs.org/package/async-mysql)
[![Travis build status](http://img.shields.io/travis/gajus/async-mysql/master.svg?style=flat)](https://travis-ci.org/gajus/async-mysql)
[![Dependency Status](https://david-dm.org/gajus/async-mysql.svg?style=flat)](https://david-dm.org/gajus/async-mysql)
async-mysql is a wrapper for [mysql](https://www.npmjs.com/package/mysql) that uses [ES7 async functions](https://github.com/lukehoban/ecmascript-asyncawait).
## Usage
```js
let mysql = require('async-mysql'),
connection,
rows;
let main;
connection = await mysql.connect({
host: 'localhost'
});
// async/await can be used only within an async function.
main = async () => {
let mysql = require('async-mysql'),
connection,
rows;
rows = await connection.query('SELECT 1');
connection = await mysql.connect({
host: 'localhost'
});
console.log('rows', rows);
rows = await connection.query('SELECT 1');
// [{'1': 1}]
// [1]
try {
await connection.query('INVALID_QUERY');
} catch (e) {
e;
// [Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INVALID_QUERY' at line 1]
}
};
main();
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc