Skip to content

Commit

Permalink
updating documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Pilafian authored and Alex Pilafian committed Apr 14, 2017
1 parent 9787466 commit 7eb953b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ non-browser environments.

### Export (Node.js Only)
```js
var exporter = require('postgres-indexed-db').exporter;
var exporter = require('postgres-indexed-db').Exporter;

//exporter config.db is fed into pg.Pool https://www.npmjs.com/package/pg
var observable = exporter({
Expand Down Expand Up @@ -42,10 +42,10 @@ non-browser environments.
### Import (Browser Only)
```js
//Import
var importer = require('postgres-indexed-db').importer;
var Importer = require('postgres-indexed-db').Importer;

//path to data from exporter as 1st param, IndexedDB name as 2nd
var observable = importer( "test/exported_data", 'test_db' );
var observable = Importer.import( "test/exported_data", 'test_db' );

observable.subscribe(function(msg_o){
switch (msg_o.message){
Expand All @@ -63,6 +63,10 @@ non-browser environments.
}
});

//idbImported can be used to query whether a database has been successfully imported.
//uses localStorage, can be used to avoid a re-import when undesirable
Importer.idbImported('test_db'); //returns true

```

## Running The Tests
Expand Down

0 comments on commit 7eb953b

Please sign in to comment.