Big update!Announcing Socket for GitHub 1.0. Learn more
Socket
BlogLoveFAQ
Install
Log in

net-listen

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Issues
File Explorer

Advanced tools

net-listen

Listen helper for net module helping with socket listening

    0.1.1latest

Version published
Maintainers
1
Weekly downloads
177
decreased by-29.48%

Weekly downloads

Readme

Source

net-listen

Node listen helper for net module helping with socket listening.

  • throw error when socket is used (server running)
  • when socket file is not used (server not running), is automatically removed and server started.
  • change socket mode to 0777 (chmod 0o777)

Installation

npm install net-listen --save

Usage

Getting started

var http = require('http'); var netListen = require('net-listen'); var server = http.createServer(); var path = 'path/to/socket.sock'; netListen.listen(server, path, function(err) { if (err) { console.error(err); process.exit(); } });

Alternative usage

netListen.listen(server, path, function(err) { ... }); netListen.listen(server, port, function(err) { ... }); netListen.listen(server, port, host, function(err) { ... }); netListen.listen(server, config, function(err) { ... });
  • path - String Unix socket file. Directory must be writable.
  • port - Number Listening TCP port
  • host - String Listening TCP host
  • config - Object Config is same as Net module listen options and can have some additional options:
    • pathMode - default 0o777

Keywords

FAQs

What is net-listen?

Listen helper for net module helping with socket listening

Is net-listen popular?

The npm package net-listen receives a total of 167 weekly downloads. As such, net-listen popularity was classified as not popular.

Is net-listen well maintained?

We found that net-listen demonstrated a not healthy version release cadence and project activity. It has 1 open source maintainer collaborating on the project.

Last updated on 09 Feb 2016
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc