# pg-live-table

> Real time monitoring of Postgres database table

Latest version **1.2.2** (published 2016-01-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install pg-live-table
pnpm add pg-live-table
yarn add pg-live-table
bun add pg-live-table
```

Provides the command `pg-live-table`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2016-01-13 |
| First published | 2015-12-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+9 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Frederic Heem |
| Maintainers | fheem |
| Keywords | pg-live-table, postgres, postgresql, real time, reactive, monitoring |

## Links

- npm: https://www.npmjs.com/package/pg-live-table
- Repository: https://github.com/FredericHeem/pg-live-table
- Issues: https://github.com/FredericHeem/pg-live-table/issues
- npm.io page: https://npm.io/package/pg-live-table

## Dependencies (7)

- [pg](https://npm.io/package/pg.md) 4.4.3
- [knex](https://npm.io/package/knex.md) 0.9.0
- [lodash](https://npm.io/package/lodash.md) ^3.8.0
- [bluebird](https://npm.io/package/bluebird.md) ^2.9.25
- [commander](https://npm.io/package/commander.md) 2.9.0
- [logfilename](https://npm.io/package/logfilename.md) 0.1.3
- [run-sequence](https://npm.io/package/run-sequence.md) ^1.1.4

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 1.2.2 (latest) — 2016-01-13
- 1.2.1 — 2015-12-10
- 1.2.0 — 2015-12-09
- 1.1.0 — 2015-12-09
- 1.0.0 — 2015-12-07

## README

> pg-live-table: Postgres live monitoring

A javascript library to monitor in real time Postgresql database table.

[![Build Status][travis-image]][travis-url]
[![Code Climate](https://codeclimate.com/github/FredericHeem/pg-live-table/badges/gpa.svg)](https://codeclimate.com/github/FredericHeem/pg-live-table) [![Coverage Status](https://coveralls.io/repos/FredericHeem/pg-live-table/badge.svg?branch=master&service=github)](https://coveralls.io/github/FredericHeem/pg-live-table?branch=master) [![NPM version][npm-image]][npm-url]

[![Dependency Status][daviddm-image]][daviddm-url]

## Install

```sh
$ npm install --save pg-live-table
```


## Usage

```js
import PgLiveTable from 'pg-live-table';

let dbUrl = 'postgres://username:password@localhost/database';
let liveTable = PgLiveTable({dbUrl: dbUrl);

let ee = await liveTable.monitor('mytable');
ee.on('insert', (payload) => {
  console.log(`GOT insert: data: ${payload.data}`);
})
.on('update', (payload) => {
  let {old_data, new_data} = payload;
  console.log(`GOT update: old: ${old_data}, new: ${new_data}`);
})
.on('delete', (payload) => {
  console.log(`GOT delete: data: ${payload.data}`);
});

await liveTable.listen();

//When done, don't forget to call liveTable.close()

```

## Test

Make sure Postgres is running locally before running the test

    $ npm test

## License

MIT © [Frederic Heem](https://github.com/FredericHeem)


[npm-image]: https://badge.fury.io/js/pg-live-table.svg
[npm-url]: https://npmjs.org/package/pg-live-table
[travis-image]: https://travis-ci.org/FredericHeem/pg-live-table.svg?branch=master
[travis-url]: https://travis-ci.org/FredericHeem/pg-live-table
[daviddm-image]: https://david-dm.org/FredericHeem/pg-live-table.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/FredericHeem/pg-live-table

---
_Source: https://npm.io/package/pg-live-table · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
