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

@osmn-byhn/widget-core-windows

v1.0.1

Published

Windows-only desktop widget manager library.

Readme

WidgetCore 🚀 (Windows Optimized)

WidgetCore is a high-performance, Windows-optimized library built with Node.js and C++ for creating interactive and persistent desktop widgets. By leveraging the native Win32 API and WebView2, WidgetCore provides a lightweight, hardware-accelerated experience that feels like a natural part of the Windows desktop.


🏗️ Architecture: The Node-Native Bridge

WidgetCore uses a sophisticated hybrid architecture to combine the rapid development of web technologies with the power of native system APIs.

1. The Win32 Message Loop

Unlike standard Node.js applications that run on a single thread, WidgetCore spawns a dedicated, detached Win32 thread for each widget. This ensures that:

  • The Node.js event loop remains unblocked.
  • Window messages (resizing, clicking, painting) are handled with sub-millisecond latency.
  • The widget remains responsive even if the main Node.js process is busy with heavy computations.

2. OLE/COM Browser Hosting

WidgetCore embeds the Microsoft WebView2 engine (Edge/Chromium) using the IWebBrowser2 interface (via OLE). This provides:

  • Full HTML5/CSS3/ES6 support.
  • Hardware-accelerated rendering.
  • Low memory footprint compared to full Electron shells.
graph TD
    A[Node.js Logic] -- Node-API (C++) --> B[WidgetManager]
    B -- std::thread --> C[Detached Message Loop]
    C -- Win32 API --> D[WS_EX_LAYERED Window]
    D -- OLE/COM --> E[WebView2 Engine]
    E --> F[Example: Cyber-Glow Widget]

✨ The "Cyber-Glow" Mode (Native Features)

WidgetCore is designed for high-end desktop aesthetics. It implements several advanced Win32 techniques:

🖼️ Aggressive Transparency

Using WS_EX_LAYERED and LWA_COLORKEY, WidgetCore achieves true transparency. The native layer uses a specific color key (RGB(1, 1, 1)) as the transparency mask, allowing for:

  • Non-rectangular widget shapes.
  • Anti-aliased "glow" effects that blend into the wallpaper.
  • No ugly borders or standard window decorations.

🌌 DWM Blur Behind

By interfacing with dwmapi.dll, WidgetCore can enable the Aero Glass / Acrylic effect behind your widget.

  • Config: Set blur: true in WidgetOptions.
  • Effect: The background of your widget will have a beautiful, frosted-glass blur that interacts with the wallpaper.

🖱️ Click-Through Interactivity

You can control how the widget interacts with the mouse:

  • Interactive (true): The widget behaves like a normal window (receives clicks).
  • Click-Through (false): Mouse events pass directly through the widget to the desktop icons or other windows behind it.

🔒 Security Shield Architecture

Security is baked into the core. Every widget is wrapped in a multi-stage Security Shield:

  1. Context Isolation: Injected CSS and JS freeze the environment. Standard Node.js entry points (process, require) are purged before the widget content loads.
  2. Protocol Filtering: Only http:, https:, and strictly validated file:/// protocols are permitted. This prevent javascript: or data: URL exploits.
  3. Keyword Scanning: All input triggers (URLs and HTML blobs) are scanned for high-risk system keywords (shell, exec, eval, process).

💾 Persistence & Standalone Execution

WidgetCore widgets can survive system reboots and process crashes.

1. The Registry Lifecycle

The AutostartManager interfaces with the Windows Registry: HKCU\Software\Microsoft\Windows\CurrentVersion\Run It creates a unique entry for each persistent widget that triggers a runner.js script on login.

2. Standalone Runner

The runner.js is a lightweight entry point that reconstructs a widget instance from the widgets.json registry file without requiring the primary application to be running.


🚀 Getting Started

Installation

npm install @osmn-byhn/widget-core-windows

Note: Requires Visual Studio Build Tools and Node-GYP for native compilation.

Basic Usage

import { DesktopWidget } from '@osmn-byhn/widget-core-windows';

const widget = new DesktopWidget("https://my-widget-dashboard.com", {
  width: 350,
  height: 500,
  x: 100,
  y: 100,
  opacity: 0.9,
  blur: true,      // Glass effect
  sticky: true     // Stays on bottom
});

🛠️ API Reference

WidgetOptions

| Property | Type | Default | Description | | :--- | :--- | :--- | :--- | | width / height | number | 400 | Dimensions in pixels. | | x / y | number | 100 | Screen coordinates (0,0 is top-left). | | opacity | number | 1.0 | Global alpha (0.0 - 1.0). | | blur | boolean | false | Enables DWM Blur Behind (Acrylic look). | | sticky | boolean | true | Pins the widget to the bottom layer (desktop). | | interactive | boolean | true | Set to false for click-through mode. | | html | string | "" | Direct HTML string if no URL is provided. |

DesktopWidget Methods

  • setPosition(x, y): Real-time window movement.
  • setOpacity(value): Smooth alpha transitions.
  • makePersistent(options): Registers the widget for autostart.
  • static stopAll(): Kills all running widget processes across the system.

📝 License

MIT License. Copyright (c) 2026 Osman Beyhan.