🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

fds

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fds

Set file descriptors to non-blocking

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

fds

Set non-block mode on file descriptors.

Why?

Part of the API contract for libuv specifies that file descriptors should already be in non-blocking mode. Newer versions of libuv set the non-blocking flag, and thus node version that utilize them have the fix. Unfortunately 0.10 and the early versions of 0.12 do not.

This is a simple backport of libuv code packaged up into a module that can be utilized everywhere.

Usage

var http = require('http');
var fds = require('fds');

fds.nonblock(3)

http.createServer(function(req, res) {
  res.writeHead(200, {
    'Content-Type': 'text/plain'
  });
  res.end('Hello World\n');
}).listen({
  fd: 3
});

Keywords

libuv

FAQs

Package last updated on 11 Apr 2016

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