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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@enotion/server

v0.1.0

Published

Backend services and APIs for accessing and managing server-side functionalities

Readme

@enotion/server

A set of server-side utilities, functions, types, and APIs.

Installation

# npm
npm install @enotion/server
# yarn
yarn add @enotion/server
# pnpm
pnpm add @enotion/server

Modules


@enotion/server/system

A collection of utilities to retrieve system information such as CPU, memory, OS, and performance metrics.

  • getSystemSnapshot(): A function that returns a promise resolving to a snapshot of the system's current state, including CPU, memory, OS, and performance metrics.
// System snapshot is the default export of the system module
import getSystemSnapshot from "@enotion/server/system";
// or
import { getSystemSnapshot } from "@enotion/server/system";
// or
import { getSystemSnapshot } from "@enotion/server";

const snapshot = await getSystemSnapshot();
console.log(snapshot);
/*
{
  cpu: { usage: 12.5, temperature: 45.0 },
  memory: { total: 16, free: 8, used: 8, usedGB: 8 , freeGB: 8, usage: 50 },
  uptime: '2h 30m 15s',
  timestamp: 1697059200000,
  info: {
    version: '20.04',
    type: 'Linux',
    platform: 'ubuntu',
    release: '5.4.0-42-generic',
    arch: 'x64',
  },
  performance: {
    uptime: "2h 30m 15s",
    loadAverage: "0.6",
  }
*/

CPU

  • cpuUsage(): An array of numbers representing the CPU usage percentage for each core.
  • cpuTemperature(): An array of numbers representing the temperature of each CPU core in Celsius.
  • parseCpuUsage(): A function that returns a promise resolving to the overall CPU usage percentage.
  • parseCpuTemperature(): A function that takes the array of CPU temperatures and returns the first valid temperature or N\A if none found.
import {
  cpuUsage,
  cpuTemperature,
  parseCpuUsage,
  parseCpuTemperature,
} from "@enotion/server";

const usage = cpuUsage(); // e.g., [12.5, 15.3, 10.8, 20.1]
const temperature = cpuTemperature(); // e.g., [45.0, 47.5, 44.0, 46.0]
const overallUsage = await parseCpuUsage(); // e.g., 14.7
const firstValidTemp = parseCpuTemperature(temperature); // e.g., 45.0

Memory

  • memoryUsage(): A function that returns a promise resolving to an object containing memory usage statistics, including total, free, used memory in GB, and usage percentage.
import { memoryUsage } from "@enotion/server/system";

const memUsage = memoryUsage();
console.log(memUsage);
/*
{
  total: 16, // in GB
  free: 8,   // in GB
  used: 8,   // in GB
  usage: 50, // in percentage
}
*/

OS

  • os(): A function that returns an object containing OS type, platform, architecture, and version.
import { os } from "@enotion/server/system";

const systemInfo = os();
console.log(systemInfo);
/*
{
  type: 'Linux',
  platform: 'ubuntu',
  architecture: 'x64',
  version: '20.04',
  release: '5.4.0-42-generic',
}
*/

Performance

  • performance(): A function that returns an object containing system performance metrics such as uptime and load average.
import { performance } from "@enotion/server/system";

const perfMetrics = performance();
console.log(perfMetrics);
/*
{
  uptime: '2h 30m 15s',
  loadAverage: '0.6',
}
*/

Disk

  • diskUsage(path: string): A function that returns a promise resolving to an object containing disk usage statistics for the specified path, including total, used, free space in GB, and usage percentage.
import { diskUsage, type DiskInfo } from "@enotion/server/system";

const usage = await diskUsage("/");
console.log(usage);
/*
{
  filesystem: '/dev/sda1',
  size: "482797652",
  used: 123456789,
  free: 359340863,
  useagePercent: 25,
  available: 359340863,
  usePercent: "25%",
  mount: '/',
}
*/

@enotion/server/network

A collection of utilities to retrieve network information such as IP addresses and network interfaces.

  • getLocalIps(): A function that returns an array of local IP addresses.
import { getLocalIps } from "@enotion/server/network";

const localIps = getLocalIps();
console.log(localIps);
/*
[
  "192.168.1.2",
  "10.0.0.5",
  "172.16.0.3"
]
*/
  • getHostname(): A function that returns the system's hostname as a string.
import { getHostname } from "@enotion/server/network";

const hostname = getHostname();
console.log(hostname); // e.g., "my-computer"
  • isPortOpen(port: number, host?: string): A function that checks if a specific port is open on the given host (defaults to localhost). Returns a promise resolving to a boolean.
import { isPortOpen } from "@enotion/server/network";

const portStatus = await isPortOpen(8080);
console.log(portStatus); // true or false
  • findAvailablePort(startPort: number, endPort: number): A function that finds an available port within the specified range. Returns a promise resolving to the available port number or null if none found.
import { findAvailablePort } from "@enotion/server/network";

const availablePort = await findAvailablePort(8000, 8100);
console.log(availablePort); // e.g., 8001 or null