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

osx-ulimit

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

osx-ulimit

A simple library that allows you to raise the low limit of file descriptors on OS X easily

  • 0.1.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by300%
Maintainers
1
Weekly downloads
 
Created
Source

osx-ulimit

Darwin (OS X kernel) has a low limit for file descriptors (256 per process) by default.

When you try to open more file descriptors than this, an exception is thrown.

This is a simple library that allows you to easily raise this limit manually for the running process.

Node.js 0.12 joyent/node@6820054 has a proper fix so you hopefully won't need it for when it's released as stable.

Warning

It still requires you to manually invoke something like launchclt limit maxfiles 10000 10000, otherwise it won't make any difference. You'll have to run this command as a system administrator / root. Do yourself a favor and read the reference. You can't turn the limit higher without invoking it with the right permissions or it'll just silently ignore it. To verify your limit use launchctl limit maxfiles.

Install

npm install osx-ulimit

Usage

require('osx-ulimit').set(); // Defaults to 30000

or

require('osx-ulimit').set(threshold);

To get the current ulimit

require('osx-ulimit').get();

If not on OSX, the above will be undefined.

The threshold should be an integer number with the minimum soft limit of file descriptors you want. Default: 30000.

Tests

Run nodeunit.

Reference

OS X ulimit guides#8

Too many files in src() leads to stack overflow vinyl-fs#14

License

MIT License

Keywords

FAQs

Package last updated on 14 Apr 2015

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