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

@jengo/mreja

v1.0.1

Published

Universal TypeScript full-stack integration toolkit for CodeIgniter 4 and the Jengo Framework ecosystem.

Readme

@jengo/mreja

Universal TypeScript full-stack integration toolkit for CodeIgniter 4 and the Jengo Framework ecosystem.

Provides reactive composables, Ziggy-style named routing, automated user timezone adaptation, live Precognitive validation for Inertia useForm, unified pagination components, Vima RBAC/ABAC authorization guards, instant search, and real-time AI token streaming.

Designed to pair with the Jengo Framework and works seamlessly across React, Vue 3, Svelte, and Vanilla TypeScript.


Installation

# npm
npm install @jengo/mreja

# pnpm
pnpm add @jengo/mreja

# yarn
yarn add @jengo/mreja

Features

1. Named Route Resolver (route())

Ziggy-equivalent named routing for CodeIgniter 4 routes registered with ['as' => '...'].

import { route } from '@jengo/mreja/routes';

// Resolve simple route
route('home'); // "/"

// Route with parameters
route('users.show', { id: 42 }); // "/users/42"

// Check current active route for nav link highlighting
route().current('users.*'); // boolean

// Extract parameters from current URL
route().params; // { id: "42" }

2. CodeIgniter 4 Time & User Timezone Bridge (useDate(), <FormattedDate />)

Automatically adapts CI4 Time timestamps to the user's browser timezone and locale.

import { useDate } from '@jengo/mreja/vue'; // or @jengo/mreja/react

const { format, fromNow, isPast } = useDate(user.created_at);

format('date'); // "Oct 6, 2026"
fromNow();      // "5 minutes ago" (auto-ticks reactively)
// React
import { FormattedDate } from '@jengo/mreja/react';

<FormattedDate value={post.created_at} relative tooltip />

3. Live Form Validation for Inertia (withPrecognition)

Enhance native Inertia useForm with server-authoritative field validation on blur/change without triggering controllers or database actions.

import { useForm } from '@inertiajs/vue3';
import { withPrecognition } from '@jengo/mreja/vue'; // or @jengo/mreja/react

const form = withPrecognition(useForm({
  username: '',
  email: '',
  password: '',
}));

// Template binding
<input v-model="form.email" @blur="form.validate('email')" />
<span v-if="form.errors.email">{{ form.errors.email }}</span>

4. Unified Pagination (<Pagination />, useInfiniteScroll())

One component supporting both CodeIgniter 4 Pager DTOs and jengo/api pagination envelopes while preserving Inertia state and query filters.

// React
import { Pagination } from '@jengo/mreja/react';

<Pagination meta={users.pager} />
// Infinite scroll
import { useInfiniteScroll } from '@jengo/mreja/vue';

const { isFetching } = useInfiniteScroll(posts, {
  onFetchNextPage: (page) => router.get(`/posts?page=${page}`, {}, { preserveState: true })
});

5. Vima & Auth Client Authorization (useAuth(), can(), requireSudo())

Evaluate Vima RBAC/ABAC permissions and GitHub-style Sudo mode on the frontend.

import { useAuth } from '@jengo/mreja/vue';

const { can, hasRole, isSudoActive, requireSudo } = useAuth();

if (can('posts.edit', post)) {
  // User can edit this post
}

// Sudo confirmation trigger
requireSudo(() => {
  deleteAccount();
});

6. Instant Search (useSearch())

Connect components to jengo/search (Meilisearch, Typesense, MySQL Full-Text) with automatic debouncing, cancellation, and faceting.

import { useSearch } from '@jengo/mreja/react';

const { query, setQuery, results, isSearching, setFilter } = useSearch('/api/v1/search/articles');

7. Real-Time AI Token Streaming (useAiStream())

Stream LLM tokens from jengo/ai's ->toSseResponse() endpoints with a single hook.

import { useAiStream } from '@jengo/mreja/vue';

const { stream, isStreaming, send, abort } = useAiStream('/ai/chat');

send('Write an essay on modern PHP');

8. Fluent API Query Builder (createApiQuery())

Build query strings adhering to jengo/api resource query parameter conventions.

import { createApiQuery } from '@jengo/mreja/api';

const url = createApiQuery('/api/v1/users')
  .page(2)
  .limit(20)
  .sort('created_at', true)
  .search('Alice')
  .derive(['profile', 'posts'])
  .filter('is_active', true)
  .build();

// "/api/v1/users?page=2&limit=20&sort=-created_at&search=Alice&derive=profile,posts&filter[is_active]=true"

License

MIT License © Ian Otieno / Jengo Framework.