Include example, link to library README

This commit is contained in:
danbulant 2019-09-28 19:37:17 +02:00
parent 4fb1cd384a
commit 0a07c448d9
2 changed files with 20 additions and 0 deletions

View file

@ -1,5 +1,7 @@
# SQL2CSV
Using sql2csv in code? see lib/README.md
Convert MySQL SELECT to CSV format
## Config

View file

@ -2,6 +2,8 @@
(!https://img.shields.io/npm/v/auto-sql2csv/latest)[https://www.npmjs.com/package/auto-sql2csv]
[![NPM](https://nodei.co/npm/auto-sql2csv.png)](https://nodei.co/npm/auto-sql2csv/)
Run `npm install auto-sql2csv`.
# Why?
@ -37,3 +39,19 @@ Usage is pretty straight forward. Currently this package has support only for my
| setOption | option name, new value | Sets new value to option |
| setOptions | options | Overwrites options object with the one provided |
| setConnection | conn | Sets new connection |
## Example
`js
const sql2csv = require("sql2csv");
const mysql = require("mysql");
const s2c = new sql2csv({
logging: true,//Log to console
skipMysqlCheck: true,//Skip mysql check, as it's surely there
colors: true,//Use colors, default value (could be ommited)
showNames: true,//Show column names in first row
crlf: false,//Use only linux lf
conn: conn //Connection to use
});
`