1.0.4 • Published 1 year ago

jemalloc-check v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

jemalloc-check

A simple utility for checking whether jemalloc(https://github.com/jemalloc/jemalloc) is installed on a system.

Installation

npm install jemalloc-check

API & Usage

jemallocCheck()

Returns a promise that resolves to the file path of the stable version of jemalloc if it is available, or false if it is not available. The promise will resolve with false on Windows systems, as jemalloc is a Linux/Unix tool.

const { jemallocCheck } = require('jemalloc-check');

jemallocCheck().then((result) => {
  if (result) {
    console.log(`jemalloc is installed at ${result}`);
  } else {
    console.log('jemalloc is not installed');
  }
});

Command-line usage

You can run the checker with the following one liner:

> npx jemalloc-check

Or ou can also use jemalloc-check as a command-line tool by installing it globally:

> npm install -g jemalloc-check

Then, you can run the jemalloc-check command to check for the presence of jemalloc on the system:

> jemalloc-check

Debugging

To enable debug logs, set the DEBUG environment variable to jemalloc-check:* before running the jemalloc-check command or calling the jemallocCheck function:

DEBUG=jemalloc-check:* jemalloc-check
process.env.DEBUG = 'jemalloc-check:*';
const jemallocCheck = require('jemalloc-check');

jemallocCheck().then((result) => {
  if (result) {
    console.log(`jemalloc is installed at ${result}`);
  } else {
    console.log('jemalloc is not installed');
  }
});

License

MIT

Credits

This package was created with the help of Assistant