npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

envni

v1.0.1

Published

A unified module and CLI for getting runtime and system information.

Readme

Envni

Envni is a lightweight, unified CLI and module for getting system and runtime information. It works seamlessly across different JavaScript runtimes, including Bun and Node.js, providing essential details about your system's memory, CPU, and the current execution environment.

Features

  • Cross-Runtime Compatibility: Automatically detects and provides information for both Bun and Node.js.
  • Comprehensive Info: Get detailed metrics on runtime, memory usage, and CPU performance.
  • Zero Dependencies: The core functionality of this tool relies only on built-in Node.js APIs, so there are no external dependencies to manage.
  • Clean Output: Presents information in a clean, human-readable format directly in your terminal.
  • Module and CLI: Available both as a CLI for easy terminal use and as a module for embedding system info functionality in your JavaScript projects.

Installation

To install Envni globally and use it as a command-line tool, run the following command:

npm install -g envni

If you want to use it as a module, you can install it via npm as well:

npm install envni

Usage

Once installed, you can use the envni command directly from your terminal or import it into your JavaScript code.

Using as a CLI

Get All System Information

To get a complete overview of your system's runtime, memory, and CPU, use the info command.

envni info

Example Output:

🌐 System Information

📊 Runtime:
  › node

💾 Memory:
  › Total: 8.00 GB
  › Used:  4.00 GB
  › Free:  4.00 GB

🧠 CPU:
  › Model: Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz
  › Cores: 8
  › Speed: 3999 MHz
  › Load Average (1m, 5m, 15m): 1.47, 1.42, 1.22

Get Memory Information

To view only the memory details, use the memory command.

envni memory

Example Output:

💾 Memory:
  › Total: 8.00 GB
  › Used:  4.00 GB
  › Free:  4.00 GB

Get CPU Information

To view only the CPU details, use the cpu command.

envni cpu

Example Output:

🧠 CPU:
  › Model: Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz
  › Cores: 8
  › Speed: 3999 MHz
  › Load Average (1m, 5m, 15m): 1.47, 1.42, 1.22

Using as a Module

To use Envni in your JavaScript project, import it and access its methods to get system info.

Example:

import systemInfo from 'envni';

// Get memory information
const memory = systemInfo.memory;
console.log(`Memory - Total: ${memory.total / 1024 / 1024 / 1024} GB, Used: ${memory.used / 1024 / 1024 / 1024} GB, Free: ${memory.free / 1024 / 1024 / 1024} GB`);

// Get CPU information
const cpu = systemInfo.cpu;
console.log(`CPU - Model: ${cpu.model}, Cores: ${cpu.cores}, Speed: ${cpu.speed} MHz`);

Example Output:

Memory - Total: 8.00 GB, Used: 4.00 GB, Free: 4.00 GB
CPU - Model: Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz, Cores: 8, Speed: 3999 MHz

How It Works

Envni detects the current runtime by checking for global objects specific to each environment (Bun for Bun, process for Node.js). It then uses the built-in os module to access low-level system information, which is consistently available across both runtimes. The output is formatted directly using ANSI escape codes for coloring, ensuring a fast and lightweight user experience without any external dependencies.

The SystemInfo Class

The core of the module is the SystemInfo class, which provides two main properties: memory and cpu.

  1. memory: Returns an object containing the total, used, and free memory in bytes.
  2. cpu: Returns an object with detailed CPU information, including:
    • model: The CPU model.
    • speed: The CPU speed in MHz.
    • cores: The number of CPU cores.
    • usage: The CPU usage.
    • times: An object detailing the CPU times (user, sys, idle, etc.).
    • loadAvg: The load averages for the system (1m, 5m, 15m).

Contributing

If you find a bug or have an idea for an improvement, feel free to open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License.