sqlite-conn
Connect to sqlite3 database and save select queries to JSON format.
Installation
sqlite-conn requires sqlite3 to run.
Install the dependencies and devDependencies and start the server.
$ npm install -sqlite-conn
Example
For production environments... database is exampl from sqlite3 page.
const sqlite3 = require('sqlite3').verbose();
const fs = require('fs');
const dr = require('sqlite-conn');
//file .json to save the result of the sql query
const file = "OneValue.json";
//database file
const mdb = '../../baza/chinook.db';
//sql queries
var sql = 'SELECT distinct FirstName,LastName,InvoiceDate,Total,invoiceId,CustomerId FROM InvoicesTrackCustomerVw WHERE CustomerId = 25';
dr.saveDataToJson(mdb,sql,file);