New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

memtrack-js

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

memtrack-js

<a href="ht

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

RamMonitor

Memtrack-js is a lightweight library for Node.js/Bun that allows you to monitor the RAM usage of a process between a start and stop point.
It provides maximum, minimum, and average RAM usage during code execution.

🚀 Installation

With npm:

npm install memtrack-js

With yarn:

yarn add memtrack-js

⚡ Basic Usage

import { RamMonitor } from 'memtrack-js';

const monitor = new RamMonitor();

monitor.start();

// code to monitor
const arrs: number[][] = [];
for (let i = 0; i < 5; i++) {
    arrs.push(new Array(1e6).fill(i));
    monitor.record(); // optional, updates max/min during the loop
}

monitor.stop();

📊 Console Output

──────────────────────────────
 RAM Monitor Stats 
──────────────────────────────
 Max Usage:     200.45 MB
 Min Usage:     114.18 MB
 Average Usage: 157.32 MB
──────────────────────────────

🔧 Features

  • Measures real-time RAM usage of a Node.js/Bun process.

  • Calculates Max, Min, and Average from recorded values.

  • Supports manual record updates during execution.

  • Output is colorful and readable using chalk.

  • Easy to integrate into any Node.js/TypeScript project.

    📄 License

    MIT License © 1gatto1

Keywords

ram

FAQs

Package last updated on 07 Oct 2025

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