sqlite2json

0.4.6 • Public • Published

sqlite2json

Maps SQLite3 data to JSON by running multiple queries against the DB.

Getting Started

Install like this:

npm install sqlite2json

Use as follows:

var S2J = require('sqlite2json');

var s2j = new S2J('/path/to/the/db.sqlite');

s2j.addQuery('query', 'SELECT column FROM table');

s2j.run(function(err, json)
{
    if (err)
    {
        console.log('There was an error: %s', err);
    }
    else
    {
        console.log('Here is your JSON: %s', json);

        // Prints something like {"query": [{"column": "a"}, {"column": "b"}]}
    }
});

License

Copyright (c) 2014 Nicola Orritos
Licensed under the MIT license.

Package Sidebar

Install

npm i sqlite2json

Weekly Downloads

1

Version

0.4.6

License

MIT

Last publish

Collaborators

  • nicolaorritos