From 0a07c448d9d07e7eaa542bc91d059c96b5bf4f9d Mon Sep 17 00:00:00 2001 From: danbulant Date: Sat, 28 Sep 2019 19:37:17 +0200 Subject: [PATCH] Include example, link to library README --- README.md | 2 ++ lib/README.md | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/README.md b/README.md index 34eb213..537bb43 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # SQL2CSV +Using sql2csv in code? see lib/README.md + Convert MySQL SELECT to CSV format ## Config diff --git a/lib/README.md b/lib/README.md index 99b37b1..2951c9a 100644 --- a/lib/README.md +++ b/lib/README.md @@ -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 + }); +`