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

nuxt-cap

v1.0.1

Published

🧢 Integrate Cap into your Nuxt websites/applications.

Readme

🚀 Setup

Install nuxt-cap dependency to your project:

npx nuxt module add nuxt-cap

Or manually

  1. Install with your favorite package manager:

    • bun : bun add nuxt-cap
    • npm : npm i nuxt-cap
    • pnpm : pnpm add nuxt-cap
    • yarn : yarn add nuxt-cap
  2. Add it to your modules section in your nuxt.config:

export default defineNuxtConfig({
  modules: ['nuxt-cap'],
  cap: {
    // ...configs
  },
})

⚙️ Configuration

You can configure nuxt-cap in two ways:

1️⃣ Using nuxt.config.ts

Set the apiEndpoint directly in your Nuxt configuration:

export default defineNuxtConfig({
  cap: {
    apiEndpoint: 'https://cap.example.com/<KEY>/',
  },
})

2️⃣ Using an Environment Variable (Recommended)

NUXT_PUBLIC_CAP_API_ENDPOINT="https://cap.example.com/<KEY>/"

Because this uses Nuxt runtimeConfig, it supports runtime environment variables — meaning you can change the endpoint after build time without rebuilding your application.

🧩 <Cap /> Component

This module auto-imports a component called:

<Cap />

📡 Emits

The component exposes four events:

  • @solve
  • @error
  • @reset
  • @progress

Example

<script setup lang="ts">
  function onSolve(event: CapSolveEvent): void {
    console.log('Solved:', event)
  }

  function onError(event: CapErrorEvent): void {
    console.error('Error:', event)
  }

  function onReset(event: CapResetEvent): void {
    console.log('Reset:', event)
  }

  function onProgress(event: CapProgressEvent): void {
    console.log('Progress:', event)
  }
</script>

<template>
  <Cap @solve="onSolve" @error="onError" @reset="onReset" @progress="onProgress" />
</template>

🧱 Props

workerCount?: number

Optional.

Defines how many Web Workers Cap should use to solve the proof-of-work challenge.

If not set, Cap defaults to:

navigator.hardwareConcurrency || 8

i18n?: object

Optional.

Allows you to customize the widget language.

{
  verifyingLabel?: string
  initialState?: string
  solvedLabel?: string
  errorLabel?: string
  wasmDisabled?: string
  verifyAriaLabel?: string
  verifyingAriaLabel?: string
  verifiedAriaLabel?: string
  errorAriaLabel?: string
}

Example

<template>
  <Cap
    :worker-count="4"
    :i18n="{
      verifyingLabel: 'Verificando...',
      solvedLabel: 'Verificado',
      errorLabel: 'Erro',
    }" />
</template>

🎨 Customizing Appearance

To customize Cap’s appearance, follow the official Cap widget customization guide: Customizing

🔄 Reset

To reset the Cap widget programmatically, you can use the provided helper function:

resetCap()

Example

<script setup lang="ts">
  function handleReset(): void {
    // ...anything
    resetCap()
  }
</script>

<template>
  <button @click="handleReset">Reset Cap</button>

  <Cap />
</template>

Calling resetCap() will reset the current widget state, allowing the challenge to be solved again.

🪄 useCap composable

You can use the useCap() composable for invisible mode.

It returns a Cap instance, similar to the one described in the official invisible guide:

Guide

You can call any available Cap instance method, such as cap.solve().

Example

<script setup lang="ts">
  const cap = useCap()

  async function testCap(): Promise<void> {
    if (!cap) return

    const { token } = await cap.solve()
    console.log(token)
  }
</script>

<template>
  <button @click="testCap">Solve Invisible Cap</button>
</template>

This allows you to manually trigger the proof-of-work challenge without rendering the <Cap /> checkbox widget.

📝 License

Copyright © 2026 Gabriel 'DethDKN' Rosa
This project is under MIT license