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

@z-os/core

v1.2.0

Published

Core hooks, contexts, and utilities for zOS - a web-based operating system.

Readme

@z-os/core

Core hooks, contexts, and utilities for zOS - a web-based operating system.

npm version npm bundle size

Installation

npm install @z-os/core
# or
pnpm add @z-os/core

Features

  • Window Management - Open, close, focus, minimize, maximize windows
  • Desktop Settings - Theme, wallpaper, dock configuration
  • Dock Management - Dock state and pinned apps
  • Terminal Emulator - Built-in terminal with command history
  • Overlay System - Modal and overlay management

Usage

Window Manager

import { useWindowManager } from '@z-os/core';

function MyComponent() {
  const windows = useWindowManager();

  return (
    <div>
      <button onClick={() => windows.openWindow('Calculator')}>
        Open Calculator
      </button>
      <button onClick={() => windows.closeWindow('Calculator')}>
        Close Calculator
      </button>

      {windows.isOpen('Calculator') && <CalculatorWindow />}
    </div>
  );
}

Desktop Settings

import { useDesktopSettings } from '@z-os/core';

function SettingsPanel() {
  const { theme, setTheme, customBgUrl, setCustomBgUrl } = useDesktopSettings();

  return (
    <div>
      <select value={theme} onChange={(e) => setTheme(e.target.value)}>
        <option value="dark">Dark</option>
        <option value="light">Light</option>
        <option value="auto">Auto</option>
      </select>

      <input
        type="text"
        value={customBgUrl}
        onChange={(e) => setCustomBgUrl(e.target.value)}
        placeholder="Custom wallpaper URL"
      />
    </div>
  );
}

Dock Provider

import { DockProvider, useDock } from '@z-os/core';

// Wrap your app
function App() {
  return (
    <DockProvider>
      <Desktop />
    </DockProvider>
  );
}

// Use in components
function Dock() {
  const { pinnedApps, addToDock, removeFromDock } = useDock();

  return (
    <div className="dock">
      {pinnedApps.map(app => (
        <DockIcon key={app.id} app={app} />
      ))}
    </div>
  );
}

Terminal Provider

import { TerminalProvider, useTerminal } from '@z-os/core';

function Terminal() {
  const {
    history,
    executeCommand,
    currentDirectory,
    setCurrentDirectory
  } = useTerminal();

  const handleCommand = (cmd: string) => {
    executeCommand(cmd);
  };

  return (
    <div className="terminal">
      {history.map((entry, i) => (
        <div key={i}>
          <span>{entry.prompt}</span>
          <span>{entry.command}</span>
          <pre>{entry.output}</pre>
        </div>
      ))}
    </div>
  );
}

API Reference

Hooks

| Hook | Description | |------|-------------| | useWindowManager() | Window state management (open, close, focus, minimize, maximize) | | useDesktopSettings() | Theme, wallpaper, and desktop preferences | | useDock() | Dock state and pinned applications | | useTerminal() | Terminal emulator with command execution | | useOverlays() | Modal and overlay management |

Types

type AppType =
  | 'Finder' | 'Terminal' | 'Safari' | 'Music' | 'Mail' | 'Calendar'
  | 'System Preferences' | 'Photos' | 'FaceTime' | 'TextEdit' | 'Notes'
  | 'Messages' | 'Activity Monitor' | 'Hanzo AI' | 'Lux Wallet' | 'Zoo'
  | 'Calculator' | 'Clock' | 'Weather' | 'Stickies' | 'Reminders'
  | 'Books' | 'Console' | 'Contacts' | 'Dictionary' | 'Disk Utility'
  | 'Font Book' | 'Freeform' | 'Maps' | 'News' | 'Passwords'
  | 'Podcasts' | 'Preview' | 'Stocks' | 'Translate' | 'Voice Memos';

interface WindowState {
  isOpen: boolean;
  isMinimized: boolean;
  isMaximized: boolean;
  position: { x: number; y: number };
  size: { width: number; height: number };
}

Context Providers

| Provider | Purpose | |----------|---------| | DockProvider | Dock state management | | TerminalProvider | Terminal emulator context | | QuickLookProvider | Quick Look preview system |

Bundle Size

~4 KB (gzipped)

License

MIT

Links