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

homfy

v0.1.2

Published

Scriptable home automation server with fully typed object scheme

Readme

🔺 Homfy

Homfy is scriptable home automation server with auto-generated, fully typed home object scheme, plugin system, and CLI.

Install

npm install -g homfy

Quick Start

# Start the server
homfy serve

# List all properties
homfy get

# Set a property value
homfy set livingRoom.on true

# Run an action
homfy run livingRoom.toggle

# See additional options
homfy -h

Key concepts

  • Plugins register objects (lights, sensors, switches, etc.)
  • Objects have properties (boolean, integer, float, string, color), events, and actions
  • Scripts define automations with type-safe triggers and conditions
  • Schemas are auto-generated TypeScript types for your objects
  • Plugins run in isolated Worker threads for stability and security

Writing a Plugin

Plugins are TypeScript files placed in ~/.homfy/plugins/. Each plugin exports a default function that receives a PluginAPI:

import type { PluginAPI } from "homfy";

export default function (plugin: PluginAPI) {
  const light = plugin.registerObject("livingRoom", { name: "Living Room Light" });

  light.defineProperty("on", { type: "boolean", writable: true, value: false });
  light.defineProperty("brightness", { type: "integer", writable: true, value: 100 });

  light.onSet("on", async (value) => {
    plugin.log.info(`Light → ${value ? "ON" : "OFF"}`);
    light.set("on", value);
  });

  light.defineAction("toggle", () => {
    const current = light.get?.("on") ?? false;
    light.set("on", !current);
    return { on: !current };
  });

  plugin.on("stop", () => {
    plugin.log.info("Plugin stopped");
  });
}

Writing a script

Scripts use auto-generated schemas for type-safe automations:

import { log, trigger } from "homfy";
import $ from "../schema/index.js";

// Toggle the living room light every day at 8:00 AM
trigger({
  when: () => $.clock.time.is({ hour: 8, minute: 0, second: 0 }),
  then: async () => {
    const result = await $.livingRoomLight.toggle();
    log.info(`Morning toggle: ${JSON.stringify(result)}`);
  },
});

// Flash the light when the kitchen light turns on
trigger({
  when: () => $.kitchenLight.on.eq(true),
  then: async () => {
    await $.livingRoomLight.flash(2);
  },
});

Homfy home directory structure

~/.homfy/
├── settings.json       # Server settings (port, host)
├── plugins/            # Plugin files (.ts)
├── scripts/            # Automation scripts (.ts)
└── schema/             # Auto-generated TypeScript schemas

Tech Stack

  • Runtime: Node.js ≥ 22, ESM, strict TypeScript
  • HTTP: Hono
  • CLI: Commander
  • Plugin loader: jiti (TypeScript without a build step)
  • Intentionally minimal dependencies

HTTP API

All endpoints are POST with JSON bodies, RPC-style:

| Endpoint | Description | | ---------------- | -------------------------------- | | health-check | Server status and uptime | | plugins.list | List loaded plugins | | objects.list | List all objects with properties | | objects.get | Get a single object | | objects.rename | Rename an object | | props.get | Get a property value | | props.set | Set a writable property | | props.watch | SSE stream for property changes | | actions.list | List available actions | | actions.run | Invoke an action |

All paths are prefixed with /api/ (e.g. POST /api/objects.list).

License

MIT