# nor-pgrunner

> PostgreSQL Database Server Runner for Node.js

Latest version **1.3.1** (published 2019-01-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install nor-pgrunner
pnpm add nor-pgrunner
yarn add nor-pgrunner
bun add nor-pgrunner
```

Provides the command `nor-pgrunner`.

## 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.3.1 |
| Published | 2019-01-05 |
| First published | 2014-03-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 23.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Juho Juopperi |
| Maintainers | jhh |

## Links

- npm: https://www.npmjs.com/package/nor-pgrunner
- Repository: https://github.com/sendanor/nor-pgrunner
- Issues: https://github.com/sendanor/nor-pgrunner/issues
- npm.io page: https://npm.io/package/nor-pgrunner

## Dependencies (8)

- [q](https://npm.io/package/q.md) ^1.5.1
- [temp](https://npm.io/package/temp.md) ^0.8.3
- [merge](https://npm.io/package/merge.md) ^1.1.3
- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [rimraf](https://npm.io/package/rimraf.md) ^2.2.8
- [optimist](https://npm.io/package/optimist.md) ^0.6.1
- [@norjs/is](https://npm.io/package/@norjs/is.md) ^1.3.0
- [@norjs/debug](https://npm.io/package/@norjs/debug.md) ^1.3.0

## Recent versions

- 1.3.1 (latest) — 2019-01-05
- 1.3.0 — 2019-01-05
- 1.0.2 — 2016-08-05
- 1.0.1 — 2016-08-05
- 1.0.0 — 2016-07-30
- 0.3.0 — 2016-07-30
- 0.1.24 — 2016-07-30
- 0.2.0 — 2015-11-26
- 0.1.23 — 2015-05-30
- 0.1.22 — 2015-04-15
- 0.1.21 — 2015-02-22
- 0.1.20 — 2015-01-22
- 0.1.19 — 2014-12-29
- 0.1.18 — 2014-12-26
- 0.1.17 — 2014-12-25
- … 18 more at https://npm.io/package/nor-pgrunner/versions

## README

nor-pgrunner
============

Utility which can be used to start PostgreSQL server instances temporarely. Good for testing.

### TODO

We use [Trello board](//trello.com/b/aq9cAAiG/nor-pgrunner) to organize development and keep track on things to do.

### Installation

Install from NPM: `npm install -g pgrunner`

### Usage over CLI

Use with CLI:

```
pgrunner create
pgrunner destroy
```

### Usage over Node.js

Use with Node.js:

```
var pgrunner = require('nor-pgrunner');
```

Example usage:

```
pgrunner({
	'host': '127.0.0.1',  // Defaults to '127.0.0.1'
	'port': 55432,        // Defaults to '55432'
	'user': 'foo',        // Defaults to USER from ENV
	'database': 'dbname'  // Defaults to same value as the user option
}).then(function(server) {
	
	// server.pgconfig is a string like 'pg://jhh@127.0.0.1:55432/jhh'
	// server.settings has the same options as properties: host, port, user, database
	// server.env has the environment variables the server is using
	
	// Stop the instance
	return server.stop().then(function() {
		console.log('Stopped successfully');
	});

}).fail(function(err) {
	console.log('Error: ' + err);
}).done();
```

Commercial Support
------------------

You can buy commercial support from [Sendanor](http://sendanor.com/software).

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