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 🙏

© 2024 – Pkg Stats / Ryan Hefner

memory-lite

v1.0.0

Published

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

Downloads

2

Readme

Memory Lite

Description

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

Table of Contents

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

| Name | Default | Description | | -------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------- | | interval | 10000 (ms) | The sampling rate expressed as time between sample (and subsequent logging) events. | | rss | true | Determines whether or not rss should be included in the output. | | heapTotal | true | Determines whether or not heapTotal should be included in the output. | | heapUsed | false | Determines whether or not heapUsed should be included in the output. | | external | false | Determines whether or not external should be included in the output. | | arrayBuffers | false | Determines 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