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

@iyulab/modern-app

v0.3.1

Published

web-framework by iyulab based on lit-element

Readme

Modern App

A modern web application framework by iyulab, built on React and Lit Element.

For complete examples and documentation, visit our demo site: https://modern-app.iyulab.com

Installation

npm install @iyulab/modern-app

Architecture

@iyulab/modern-app is a client-side SPA framework built on Lit Element. It is designed for:

Suitable for:

  • Single Page Applications (SPA)
  • Admin dashboards and internal tools
  • Progressive Web Apps (PWA)
  • Projects where SEO is not a primary concern

Not suitable for:

  • Server-Side Rendering (SSR) frameworks (Next.js, Nuxt, SvelteKit, etc.)
  • Static Site Generation (SSG)
  • SEO-critical public-facing pages
  • Projects requiring initial HTML content for search engines

This is by design — Lit components render on the client side. If you need SSR capabilities, consider using Lit's experimental SSR support separately or choose a framework designed for SSR from the start.

Quick Start

import { app } from '@iyulab/modern-app';

await app.load({
  basepath: '/',
  layout: {
    type: 'sidebar',
    // ...layout configuration
  },
  routes: [
    { index: true, render: () => html`<home-page></home-page>` },
    { path: 'about', render: () => html`<about-page></about-page>` },
  ],
});

API Reference

Navigation

// Navigate to a path
app.navigate('/path');

// Access router instance
app.router?.go('/path');
app.router?.basepath;   // Get base path
app.router?.routes;     // Get registered routes
app.router?.context;    // Get current route context

Theme Management

// Get current theme
app.theme.get();  // Returns: 'system' | 'light' | 'dark' | undefined

// Set theme
app.theme.set('dark');   // 'system' | 'light' | 'dark'

// Check initialization status
app.theme.isInitialized;

Notifications

// Display notifications (returns Promise<void>)
await app.notice('Notice message');
await app.info('Info message');
await app.success('Success message');
await app.warning('Warning message');
await app.error('Error message');

// With options
await app.success('Saved!', {
  title: 'Success',
  duration: 5000,  // milliseconds (default: 3000)
  position: 'top-right'  // 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'
});

Localization

// Access i18next instance
app.localizer;  // i18next instance

// Usage with lit-i18n
import { translate } from 'lit-i18n';
html`<p>${translate('namespace::key')}</p>`;

Configuration

AppConfig

interface AppConfig {
  root?: Element;              // Root element (default: document.body)
  basepath?: string;           // Base path for routing (default: '/')
  routes: RouteConfig[];       // Route definitions
  fallback?: FallbackConfig;   // Error fallback route
  theme?: ThemeInitOptions;    // Theme configuration
  localization?: i18next.InitOptions;  // i18next options
  layout: LayoutConfig;        // Layout configuration
}

Theme Options

interface ThemeInitOptions {
  default?: 'system' | 'light' | 'dark';  // Default theme
  debug?: boolean;                         // Enable debug logging
  store?: false | {                        // Persist theme preference
    type: 'cookie' | 'localStorage' | 'sessionStorage';
    prefix?: string;
  };
  useBuiltIn?: boolean;  // Use built-in styles (default: true)
}

Layout Configuration (Sidebar)

interface SidebarLayoutConfig {
  type: 'sidebar';
  breakpoints?: [number, number];  // [small, medium] (default: [768, 1024])
  logo?: {
    type: 'icon' | 'image';
    icon?: string;
    src?: string;
    label?: string;
    onClick?: () => void;
  };
  menu?: MenuItem[];     // Navigation menu items
  footer?: FooterItem[]; // Footer buttons/items
}

Route Configuration

interface RouteConfig {
  index?: boolean;           // Index route
  path?: string;             // Route path (supports :param patterns)
  title?: string;            // Document title
  force?: boolean;           // Force re-render
  render: (context: RouteContext) => RenderResult | Promise<RenderResult>;
}

interface RouteContext {
  href: string;              // Full URL
  pathname: string;          // Path portion
  basepath: string;          // Base path
  params: Record<string, string>;  // URL parameters
  progress: (value: number) => void;  // Progress callback (0-100)
}

License

MIT