memmonit
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/memmonit package

1.2.2 • Public • Published

Memmonit

NPM Version NPM Downloads Build Status

A library to help monitor operating system memory. Has typescript support!

Installation

npm install memmonit --save

Parameter information (conversion units)

Each method takes as a parameter the unit that wants to receive the memory information. The available units are Kilobyte (kB), Megabyte (MB) and Gigabytes (GB).

Usage examples

  • ## Get memory usage
let memmonit = require("memmonit").MemoryMonitoring;
 
let memoryUsage = memmonit.getMemoryUsage("GB");
console.log(memoryUsage);    //2.015354681
 
let memoryUsageTrunc = memmonit.memoryUsageTrunc("GB");
console.log(memoryUsageTrunc);   //2
 
let memoryUsageFixed = memmonit.getMemoryUsageFixed("GB", 2);
console.log(memoryUsageFixed);   //2.02
  • ## Get memory total
let memmonit = require("memmonit").MemoryMonitoring;
 
let memoryTotal = memmonit.getMemoryTotal("GB");
console.log(memoryTotal);    //15.364312
 
let memoryTotalTrunc = memmonit.getMemoryTotalTrunc("GB");
console.log(memoryTotalTrunc);   //15
 
let memoryTotalFixed = memmonit.getMemoryTotalFixed("GB", 2);
console.log(memoryTotalFixed);   //15.36
  • ## Register memory usage Records the memory monitoring in the file passed in the first parameter of the method
let memmonit = require("memmonit").RegisterMonitoring;
 
memmonit.registerMemoryUsage("./test.txt", "GB")
memmonit.registerMemoryUsageTrunc("./test.txt", "GB")
memmonit.registerMemoryUsageFixed("./test.txt", "GB")

/memmonit/

    Package Sidebar

    Install

    npm i memmonit

    Weekly Downloads

    8

    Version

    1.2.2

    License

    ISC

    Unpacked Size

    14.2 kB

    Total Files

    9

    Last publish

    Collaborators

    • diegodamato