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

@jopijs/jopimod_uicore

v1.0.3

Published

This module is the **Standard Library** of the JopiJS framework. It provides the essential building blocks, hooks, and utilities required to build the user interface and handle client-side logic.

Downloads

199

Readme

@jopijs/jopimod_uicore

This module is the Standard Library of the JopiJS framework. It provides the essential building blocks, hooks, and utilities required to build the user interface and handle client-side logic.

Role of the Module

The mod_uicore module serves as the foundation for:

  • Routing & Navigation: Provides standard hooks (useLocation, useNavigate) and the <Link> component.
  • Client-Server Communication: Utilities to easily send JSON or Form data to the server (useSubmit, sendJsonData).
  • User Session Management: hooks to access current user info (useGetInfos) and check permissions (useHasAllRoles, <CheckRoles>).
  • Cross-Tab Communication: The CrossTabEvent class to synchronize state between multiple browser tabs.

Structure

The module organizes its features through standard aliases:

  • @alias/hooks: React hooks for logic (navigation, user session, network).
  • @alias/lib: Pure logic classes and functions (CrossTabEvent, string tools).
  • @alias/ui: Core UI components (Link, CheckRoles, Composite).

API Reference

Navigation (Router)

  • useNavigate(): Programmatically change routes.
  • useLocation(): Get current location object.
  • useParams(): Get route parameters (e.g. id in /product/:id).
  • useSearchParams(): Get query parameters (?q=search).
  • <Link to="...">: Declarative navigation component.

User & Authentication

  • useGetInfos(): Returns the current user's profile (or anonymous).
  • useHasAllRoles(roles[]): Returns true if user has all specified roles.
  • useLogOut(): Function to log the user out.
  • <CheckRoles roles={[...]}>: Conditionally renders content based on permissions.

Server Interaction

  • useSubmit(url, options): Hook to handle form submissions with loading states.
  • sendJsonData(url, data): Helper to POST JSON data.

Utilities

  • CrossTabEvent: Class to broadcast events to other open tabs of the same application.
  • Composite: Component to create "slots" where other modules can inject content.

Examples

1. Navigation

import { Link } from "jopijs/router"; // Mapped to @alias/ui/jopijs.page.Link
import useNavigate from "jopijs/router/useNavigate"; // Mapped to hooks

export const MyNav = () => {
    const navigate = useNavigate();

    return (
        <div>
            <Link to="/home">Go Home</Link>
            <button onClick={() => navigate("/dashboard")}>
                Go to Dashboard
            </button>
        </div>
    );
};

2. Checking Permissions

import { CheckRoles } from "jopijs/security"; // Mapped to user components
import useGetInfos from "@/hooks/jopijs.user.useGetInfos";

export const AdminPanel = () => {
    const user = useGetInfos();

    return (
        <CheckRoles roles={["ADMIN"]}>
            <h1>Welcome, {user.login}</h1>
            <p>You have access to the secret panel.</p>
        </CheckRoles>
    );
};

3. Synchronizing Tabs

import { CrossTabEvent } from "@/lib/jopijs.client.CrossTabEvent";

const sync = new CrossTabEvent("my.app.sync");

// Send signal
sync.emit({ some: "data" });

// Listen in another tab
sync.listen((data) => {
    console.log("Received Sync:", data);
});