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

@crbroughton/nuxt-auto-layers

v0.3.0

Published

Automatically discover and extend Nuxt layers without manual configuration. Simplifies modular architecture by eliminating boilerplate configuration and enabling zero-config layer setup

Readme

nuxt-auto-layers

🚀 Automatically discover and extend Nuxt layers with zero configuration

This module automatically detects all layers within your project and sets up the necessary configuration without you having to manually declare each layer.

Features

  • Auto-discovery: Automatically finds all layers in your project
  • Auto-routing: Creates routes for each layer's index.vue file
  • Auto-registration: Automatically registers components, composables, plugins, utils, and shared folders
  • Zero configuration: Works out of the box with sensible defaults
  • Fully customizable: Control which features to auto-register

Note

At a technical level, this module is somewhere between a layer and a module; The main purpose of this module is to remove the boilerplate with layers for a more streamlined folder structure and remove the need to declare individual nuxt.config.ts files for every layer.

Quick Setup

  1. Add nuxt-auto-layers dependency to your project
npm install @crbroughton/nuxt-auto-layers
  1. Add nuxt-auto-layers to the modules section of nuxt.config.ts
export default defineNuxtConfig({
  modules: [
    '@crbroughton/nuxt-auto-layers'
  ],
  future: {
    compatibilityVersion: 4, // <- enable Nuxt 4 app folder
  },
})

That's it! The module will automatically:

  • Discover all directories in app/layers and add them as Nuxt layers
  • Register routes for each layer's index.vue file
  • Register components, composables, plugins, utils and shared folders from each layer

How It Works

This module scans your project for directories within the app/layers folder (configurable) and automatically:

  1. Adds each directory as a Nuxt layer through the extends configuration
  2. Creates routes for each layer's root index.vue file (e.g., app/layers/admin/index.vue/admin)
  3. Registers the following from each layer:
    • Components from the components directory
    • Composables from the composables directory
    • Plugins from the plugins directory
    • Utils from the utils directory
    • Shared modules from the shared directory
    • Pages (if you require for example dynamic routes)

Directory Structure

By default, the module expects your layers to be in the app/layers directory:

your-project/
├── app/
│   ├── layers/
│   │   ├── admin/
│   │   │   ├── components/    # Auto-registered
│   │   │   ├── composables/   # Auto-registered
│   │   │   ├── plugins/       # Auto-registered
│   │   │   ├── utils/         # Auto-registered
│   │   │   ├── shared/        # Auto-registered
│   │   │   ├── pages/         # Auto-registered
│   │   │   ├── index.vue      # Auto-routed to /admin (required)
│   │   │   └── ... other Nuxt directories
│   │   ├── shop/
│   │   │   ├── components/    # Auto-registered
│   │   │   ├── composables/   # Auto-registered
│   │   │   ├── plugins/       # Auto-registered
│   │   │   ├── utils/         # Auto-registered
│   │   │   ├── shared/        # Auto-registered
│   │   │   ├── pages/         # Auto-registered
│   │   │   ├── index.vue      # Auto-routed to /shop (required)
│   │   │   └── ... other Nuxt directories

Each directory under app/layers becomes a Nuxt layer, allowing you to organize your application into modular, self-contained pieces.

Configuration

You can customize the behavior of this module in your nuxt.config.ts:

export default defineNuxtConfig({
  modules: [
    '@crbroughton/nuxt-auto-layers'
  ],
  autoLayers: {
    // Custom directory for layers (default: 'app/layers')
    layersDir: 'custom/path/to/layers',
    
    // Control auto-registration features
    // Option 1: Enable/disable all features at once
    autoRegister: true, // or false to disable all
    
    // Option 2: Granular control over specific features
    autoRegister: {
      components: true,   // Auto-register components
      composables: true,  // Auto-register composables
      pages: true,        // Auto-register nested page folder
      plugins: true,      // Auto-register plugins
      utils: true,        // Auto-register utils
      shared: true        // Auto-register shared folders
    }
  }
})

License

MIT License