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 🙏

© 2025 – Pkg Stats / Ryan Hefner

reactmos

v0.6.1

Published

Reactmos is a small project, primarily a conceptual approach, inspired by [Nuxt Layers](https://nuxt.com/docs/getting-started/layers) for React.

Readme

Reactmos (REACT MOduleS)

Reactmos is a small project, primarily a conceptual approach, inspired by Nuxt Layers for React.

[!NOTE]
This project is a Work In Progress and currently supports only Single Page Applications (SPA).

See documentation

CLI

We provide a CLI to help run the development server and build the final bundle.

Reactmos

Reactmos serves as the core of the application and acts as the entry point for Vite.

Modules

This is where you will develop your application and extend other modules.

To create a new module, simply run:

pnpm create reactmos <module-name>

Configuration

See more in packages/cli/src/types.ts

const moduleConfig: ModuleConfig = {
  moduleName: 'module-boilerplate',
  /**
   * Root component of the application.
   * If not provided, Reactmos will use the root component
   * from the first extended module that defines one.
   * If no extended module provides a root component,
   * the default from the entry point will be used.
   */
  root: App,
  routes: () => {
    return [
      {
        path: '/welcome',
        Component: Welcome,
      },
    ];
  },
  hooks: {
    'app:beforeRender': () => {
      console.log('Before render')
    }
  }
}

Extending Modules

To extend another module, just add its package name to the extends field in module.config.ts:

export default {
  extends: ['module-to-extend']
}

You can also use relative path to other module directory

export default {
  extends: ['../module-to-extend']
}

Lifecycle Hooks

Reactmos provides several lifecycle hooks:

  1. app:afterBoot - Called after the CLI registers all module routes and hooks. Used by the entry point to mount the application.
  2. app:init - Called before the entry point retrieves App.tsx, which serves as the root of the application.
  3. app:beforeRender - Called after App.tsx is retrieved but before calling render from createRoot.
  4. app:afterRender - Called after createRoot executes render.

You can use app:afterBoot to create new hooks within your application:

import { hooks } from 'reactmos';

// Register a new hook called 'hello'
hooks.hook('hello', () => {
  console.log('Hello, World!');
});

// Call the 'hello' hook
hooks.callHook('hello');

For more details, see hookable.

Components

Reactmos provides a <Pages /> component that represents all registered routes. You can use it in your App.tsx root component.

Utility Functions

Reactmos also provides the following functions:

  1. getRoutes - Retrieves all registered routes.
  2. getRoot - Returns the App.tsx root component.
  3. getExtras(moduleName) - Returns extra configuration in module configs