New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

process-limits

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

process-limits

Get system limits (max open files etc) for a process ID

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

node-process-limits

Get the system limits (max open files etc) for a process ID in nodejs. It gives the same format as cat /proc/PID/limits just in a nice object that's easy to work with.

Usage

var processLimits = require("process-limits");
var pid = process.pid; // Or any other process on the machine

processLimits(process.pid, function (err, limits) {
    console.log(limits);
    /* Outputs the following: (unlimited in output is converted to the JS number Infinity)
    {
        maxCpuTime: {
            soft: Infinity,
            hard: Infinity,
            units: "seconds"
        },
        maxFileSize: {
            soft: Infinity,
            hard: Infinity,
            units: "bytes"
        },
        maxDataSize: {
            soft: Infinity,
            hard: Infinity,
            units: "bytes"
        },
        maxStackSize: {
            soft: 8388608,
            hard: Infinity,
            units: "bytes"
        },
        maxCoreFileSize: {
            soft: 0,
            hard: 0,
            units: "bytes"
        },
        maxResidentSet: {
            soft: Infinity,
            hard: Infinity,
            units: "bytes"
        },
        maxProcesses: {
            soft: 1048576,
            hard: 1048576,
            units: "processes"
        },
        maxOpenFiles: {
            soft: 1048576,
            hard: 1048576,
            units: "files"
        },
        maxLockedMemory: {
            soft: 65536,
            hard: 65536,
            units: "bytes"
        },
        maxAddressSpace: {
            soft: Infinity,
            hard: Infinity,
            units: "bytes"
        },
        maxFileLocks: {
            soft: Infinity,
            hard: Infinity,
            units: "locks"
        },
        maxPendingSignals: {
            soft: 209280,
            hard: 209280,
            units: "signals"
        },
        maxMsgqueueSize: {
            soft: 819200,
            hard: 819200,
            units: "bytes"
        },
        maxNicePriority: {
            soft: 0,
            hard: 0
        },
        maxRealtimePriority: {
            soft: 0,
            hard: 0
        },
        maxRealtimeTimeout: {
            soft: Infinity,
            hard: Infinity,
            units: "us"
        }
    }
    */
});

Test

Run tests with npm test. Let me know if any fail on your system, please include system details from uname -a.

License

MIT

Keywords

FAQs

Package last updated on 17 Mar 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

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