0.10.4 • Published 11 years ago
pg-json-data-export v0.10.4
pg-json-data-export
Export a Postgres database as JSON
Install
$ npm install pg-json-data-export --saveUsage
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