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 🙏

© 2026 – Pkg Stats / Ryan Hefner

cl-host-app-api

v1.3.1

Published

Api for Host Client App (Dashboard)

Readme

Host App Client

Client library for interacting with Host App Api. For use in dashboard browser/mobile app.

Terminology

Host

Host is a container with a dedicated IP address. Each user can have multiple containers. Containers have different sizes (cpu, mem, disk).

Host Application

Host Application provides user interface for project management and monitoring of host resources (cpu, mem, disk).

Project

Project is a cluster of services (Docker containers) linked together in an isolated network. Each project must have it's unique slug name. Slug is a value at least 3 characters long and can only contain -[a-z0-9] (for example my-project-1).

Project Service

Project service is a docker container running a specific image (for example node:4, or mysql, etc.). Each service can have defined specific configuration (for example {"rootPassword": "test1234", "defaultDatabase": "test"}) and port forwarding (host port to container port). Multiple ports can be assigned to each service but no two services can share the same source port (host port).

Usage

Local dev

For local development use DummyHostAppClient to simulate real client behaviour without running entire infrastructure.

Basic usage

/*
  NOTE: `HostAppApi` is for example showcase only and should be replaced with relative path or else 
*/
import { DummyHostAppClient } from 'HostAppApi'
import {
  Project,
  createProjectSlug,
  createProjectName,
  createServiceCode,
  createNetworkPort,
  ClientEvents,
  ProjectState
} from 'HostAppApi'

const client = new DummyHostAppClient()

client.on(ClientEvents.ProjectAdded, project => {
  console.log('project added', project)
})

client.on(ClientEvents.ProjectUpdated, project => {
  console.log('project updated', project)
})

client.on(ClientEvents.ProjectRemoved, project => {
  console.log('project removed', project)
})

const testProject1 = {
  slug: createProjectSlug('project-1'),
  name: createProjectName('Test Project 1'),
  services: [
    {
      service: createServiceCode('node:4'),
      base: true,
      ports: [
        {
          source: createNetworkPort(2000),
          destination: createNetworkPort(3000)
        }
      ]
    } 
  ]
}

client.createProject(testProject1)

testProject1.name = createProjectName('Test Project 1 Updated')
client.updateProject(testProject1)

client.startProject(testProject1)
client.stopProject(testProject1)

client.deleteProject(testProject1)

Dummy Client specific methods

Call these methods for local tests

  • initTestData - Auto generates predefined projects (to simulate existing projects on real host)
  • startSysUsageGenerator - Starts hardware usage events simulation (cpu, mem, disk usage events)
  • endSysUsageGenerator - Stops hardware usage events simulation. Use this method to clear interval timer (needed to finish tests, etc., use in afterAll method for example)

For example

client.initTestData()
client.startSysUsageGenerator()