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

grenton-ts

v1.0.0

Published

TypeScript API library providing type-safe wrappers for Grenton smart home hardware modules

Readme

grenton-ts

TypeScript API library for Grenton smart home hardware modules. Provides type-safe wrappers around the low-level Grenton hardware interfaces, making it easier to interact with Grenton devices in TypeScript projects.

Overview

Grenton devices expose a raw Lua-based API. This library wraps those raw interfaces with typed TypeScript classes, giving you:

  • Typed properties with getters/setters
  • Typed events with callback registration
  • Typed methods for executing device commands
  • Remote variants for cross-gate (CLU-to-CLU) communication

Each hardware module directory contains firmware-versioned subdirectories (e.g. fv03_02) so multiple firmware versions of the same module can coexist.

Architecture

Every module follows the same three-layer pattern:

1. Raw Interface (*Raw)

A declare class mirroring the low-level hardware API:

declare class RollerShutterRaw {
    add_event(event: EventType, callback: () => void): void;
    get(property: PropertyType): any;
    set(property: PropertyType, value: any): void;
    execute(method: MethodType, ...args: any[]): any;
}

2. Wrapper Class

A high-level class that takes the raw interface in its constructor and exposes typed methods, properties, and event registration:

import { RollerShutter, RollerShutterRaw } from './roller-shutter-din-3/fv03_02/roller-shutter';

const shutter = new RollerShutter(rawRollerShutter);

// Events
shutter.addOnPositionChange(() => {
    console.log('Position:', shutter.position);
});

// Methods
shutter.moveUp(5000);     // move up for 5 seconds
shutter.setPosition(50);  // set to 50% open

// Properties
logInfo(shutter.state);    // StateType enum value
logInfo(shutter.position); // number (0–100)
shutter.maxTime = 30000;       // read/write property

3. Remote Variant (*Remote)

For controlling devices on a different CLU via RemoteGate. Uses rawExecutionBuilderFactory to build command strings sent over the gate. Remote events are not supported.

import { RollerShutterRemote } from './roller-shutter-din-3/fv03_02/roller-shutter';
import { RemoteGate } from './core/remote-gate';

const gate = new RemoteGate(rawRemoteGate);
const shutter = new RollerShutterRemote('ROLLER_SHUTTER_1', gate);

shutter.moveUp(5000);
shutter.setPosition(75);

Build

npm run build   # compile TypeScript → dist/
npm run watch   # watch mode

Requires Node.js with TypeScript 5.x (devDependency). Compiled output goes to dist/.

License

MIT