pg-json-data-export

0.10.4 • Public • Published

pg-json-data-export

NPM version Build status Dependency Status

Export a Postgres database as JSON

Install

$ npm install pg-json-data-export --save

Usage

var exporter = require('pg-json-data-export');
var connection = {
  // pg connections object
};
exporter.toJSON(connection, 'public')
  .then(function (dump) {
    console.log(dump.table1.rows);
  });

API

.toJSON (connection, schema)

@param description
connection connection string or object compatible with pg
schema the database schema to export
@return description
Object dump of all tables in database schema
{ table1: { rows: [ { /* ... */ } ] } }

License

MIT

Package Sidebar

Install

npm i pg-json-data-export

Weekly Downloads

0

Version

0.10.4

License

MIT

Last publish

Collaborators

  • tjwebb