Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-nailgun-server

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-nailgun-server

A Node.js module for running Nailgun servers

  • 0.2.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

node-nailgun-server

A Node.js module for running Nailgun servers.

npm Version Build Status js-standard-style

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 is recommended.

Install

npm install node-nailgun-server

Example

By the default the server will listen to all interfaces on port 2113.

var nailgun = require('node-nailgun-server');

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

In the following example node-nailgun-client is used to communicate with the server:

var nailgun = require('node-nailgun-server');
var client = require('node-nailgun-client');

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

nailgun.createServer(options, function(port) {
  var 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:

server.shutdown();

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

License

Apache License 2.0

Keywords

FAQs

Package last updated on 25 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc