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

memory-lite

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

memory-lite

A simple, bare-bones package for monitoring NodeJS memory usage using the console.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Memory Lite

Description

Memory Lite is a simple, bare-bones package for monitoring NodeJS memory usage using the console.

Table of Contents

  • Installation
  • Usage
  • Arguments
  • Contribute
  • Support

Installation

Memory Lite can be installed using the package manager of your choosing. The example command below uses yarn.

$ yarn add memory-monitor

Usage

Usage is extremely straightforward -- 1) import the package, and 2) initialized the monitor. Memory Lite can be used without passing any arguments, however all arguments and their defaults are shown below:

// <app-entry-point>.ts
import memoryMonitor from 'memory-lite';

memoryMonitor({
    interval: 10000,
    rss: true,
    heapTotal: true,
    heapUsed: false,
    external: false,
    arrayBuffers: false
});

With this default setup, the following will be output to the console at 10 second intervals (numbers shown are arbitrary):

rss: 21.9 MiB | heapTotal: 4.6 MiB

If all boolean arguments set to true, the following will be output to the console:

rss: 22.9 MiB | heapTotal: 4.9 MiB | heapUsed: 4.3 MiB | external: 294.7 KiB | arrayBuffers: 43.7 KiB

Arguments

NameDefaultDescription
interval10000 (ms)The sampling rate expressed as time between sample (and subsequent logging) events.
rsstrueDetermines whether or not rss should be included in the output.
heapTotaltrueDetermines whether or not heapTotal should be included in the output.
heapUsedfalseDetermines whether or not heapUsed should be included in the output.
externalfalseDetermines whether or not external should be included in the output.
arrayBuffersfalseDetermines whether or not arrayBuffers should be included in the output.

Contribute

Contribution is welcome, although there is probably little more to be done. Some options include:

  • add ability to toggle monitor off and on
  • create options that allow for logs to be more queryable and traceable within a logging aggregator
  • save output to a variable for actionable checks (i.e. usage notifications, etc.)

These would constitute fairly large changes and may even warrant packages of their own, however they are valid ideas for improving the utility of this package.

Support

Keywords

FAQs

Package last updated on 29 Nov 2021

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