# node-nailgun-server

> A Node.js module for running Nailgun servers

Latest version **0.3.0** (published 2019-08-16) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install node-nailgun-server
pnpm add node-nailgun-server
yarn add node-nailgun-server
bun add node-nailgun-server
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2019-08-16 |
| First published | 2015-07-08 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 8.x |
| Dependencies | 0 |
| Unpacked size | 2.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Markus Hedvall |
| Maintainers | markushedvall |
| Keywords | nailgun, java, jvm |

## Links

- npm: https://www.npmjs.com/package/node-nailgun-server
- Repository: https://github.com/markushedvall/node-nailgun-server
- Homepage: https://github.com/markushedvall/node-nailgun-server#readme
- Issues: https://github.com/markushedvall/node-nailgun-server/issues
- npm.io page: https://npm.io/package/node-nailgun-server

## Recent versions

- 0.3.0 (latest) — 2019-08-16
- 0.2.1 — 2019-01-25
- 0.2.0 — 2019-01-23
- 0.1.4 — 2019-01-16
- 0.1.3 — 2015-12-06
- 0.1.2 — 2015-08-07
- 0.1.1 — 2015-07-10
- 0.1.0 — 2015-07-08

## README

# node-nailgun-server

A Node.js module for running [Nailgun](http://martiansoftware.com/nailgun/) servers.

[![npm Version](https://img.shields.io/npm/v/node-nailgun-server.svg)](https://www.npmjs.com/package/node-nailgun-server) [![Build Status](https://travis-ci.org/markushedvall/node-nailgun-server.svg)](https://travis-ci.org/markushedvall/node-nailgun-server) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)

This package enable you to run Nailgun servers through your Node.js applications.

Note that this only provides support for running Nailgun servers. If you are need of a Nailgun client for Node.js, [node-nailgun-client](https://www.npmjs.com/package/node-nailgun-client) is recommended.

# Install

```
npm install node-nailgun-server
```

# Example

By the default the server will listen to all interfaces on port 2113.
```javascript
const nailgun = require('node-nailgun-server');

const server = nailgun.createServer();
server.out.pipe(process.stdout);
```

In the following example [node-nailgun-client](https://www.npmjs.com/package/node-nailgun-client) is used to communicate with the server:
```javascript
const nailgun = require('node-nailgun-server');
const client = require('node-nailgun-client');

const options = {
  address: 'localhost',
  port: 0, // 0 lets the server choose a random port
}

nailgun.createServer(options, function(port) {
  const nail = client.exec('ng-stats', { port: port })
  nail.stdout.pipe(process.stdout);
});
```

The server object returned when creating a server provides a output stream and also a function for shutting the server down:
```javascript
server.shutdown();
```

Servers are also shutdown automatically when the Node.js process exits.

# License
Apache License 2.0

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