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

@mojimoto/nuxt

v0.1.0

Published

Nuxt 3 module for Mojimoto: auto-configured client, SSR composables, and global components.

Readme

@mojimoto/nuxt

Nuxt 3 module for Mojimoto. Auto-configures a delivery client, exposes SSR-friendly composables, and registers <MojiRichText> & friends as global components.

npm i @mojimoto/nuxt

Setup

// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@mojimoto/nuxt'],
  mojimoto: {
    endpoint: 'https://cms.yourikigai.co.uk/api/v1',
    project: 'decentenergy',
    // token: '…'  // prefer the MOJIMOTO_TOKEN env var (see below)
  },
});

Configure via env vars (recommended) instead of hardcoding:

MOJIMOTO_ENDPOINT="https://cms.yourikigai.co.uk/api/v1"
MOJIMOTO_PROJECT="decentenergy"
MOJIMOTO_TOKEN="your-read-token"

Options

| Option | Env fallback | Description | | --- | --- | --- | | endpoint | MOJIMOTO_ENDPOINT | Delivery endpoint. | | project | MOJIMOTO_PROJECT | Project slug. | | token | MOJIMOTO_TOKEN | Read token. | | lang | — | Default locale. | | preview | — | Request drafts by default. | | components | — | Register global components (default true). |

Token visibility: the read token is placed in public runtime config, so it's available for client-side navigation — exactly like a Contentful CDN token. Use a read-only token. For preview, see below.

Composables (auto-imported, SSR)

These wrap Nuxt's useAsyncData: content is fetched on the server, serialized into the payload, and hydrated on the client.

<script setup lang="ts">
const { data: home } = await useMojiDocument('marketing_page', 'home');
const { data: posts } = await useMojiQuery({ type: 'blog_post', perPage: 12 });

// Raw client for imperative use:
const cms = useMojimoto();
</script>

<template>
  <article v-if="home">
    <MojiImage :field="home.data.background_image" alt="" />
    <MojiRichText :field="home.data.body" />
  </article>
</template>

Pass an explicit cache key as the last argument when you need control: useMojiQuery({ type: 'blog_post' }, 'all-posts').

Typed content

import type { MojimotoDocument } from '@mojimoto/client';
import type { MarketingPageData } from '~/mojimoto.generated';

const { data } = await useMojiDocument<MojimotoDocument<'marketing_page', MarketingPageData>>(
  'marketing_page',
  'home',
);

Preview / draft mode

The module enables preview when the preview option is set, or when a mojimoto_preview cookie equals '1'. Add small server routes to toggle it, then point your Mojimoto project's preview URL at /api/preview:

// server/api/preview.get.ts
export default defineEventHandler((event) => {
  const { secret, redirect } = getQuery(event);
  if (secret !== process.env.MOJIMOTO_PREVIEW_SECRET) {
    throw createError({ statusCode: 401 });
  }
  setCookie(event, 'mojimoto_preview', '1', { httpOnly: false, path: '/' });
  return sendRedirect(event, (redirect as string) ?? '/');
});

// server/api/preview/exit.get.ts
export default defineEventHandler((event) => {
  deleteCookie(event, 'mojimoto_preview');
  return sendRedirect(event, '/');
});

Use a preview-capable token (MOJIMOTO_TOKEN) so draft requests are authorized.

License

MIT © Your Ikigai Ltd