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

nextjs-asset-manager

v0.1.2

Published

Next.js integration for asset management dashboard — browse, search, and manage all your project assets

Readme

nextjs-asset-manager

Official Next.js integration for vite-plugin-asset-manager — a visual asset management dashboard that discovers, catalogs, and displays all your project's media assets.

Features

  • Dev-only — returns 404 in production, zero production footprint
  • Automatic floating icon — injected via client component
  • App Router native — uses Next.js catch-all route handlers
  • HMR stableglobalThis singleton pattern survives hot module replacement
  • Composable configwithAssetManager() works alongside withSentryConfig, withBundleAnalyzer, etc.
  • Real-time updates — file changes reflected instantly via SSE
  • Thumbnail generation — Sharp-powered thumbnails with caching
  • Import tracking — see which files import each asset with click-to-open-in-editor
  • Duplicate detection — find duplicate files by content hash

Installation

npm install nextjs-asset-manager -D
# or
pnpm add nextjs-asset-manager -D
# or
yarn add nextjs-asset-manager -D

Setup

1. Wrap your Next.js config

This suppresses asset manager request logging in the dev server:

// next.config.ts
import type { NextConfig } from 'next'
import { withAssetManager } from 'nextjs-asset-manager'

const nextConfig: NextConfig = {}
export default withAssetManager(nextConfig)

2. Create the API route handler

// app/api/asset-manager/[[...path]]/route.ts
import { createHandler } from 'nextjs-asset-manager'

const { GET, POST } = createHandler()
export { GET, POST }

3. Add the client component

// app/layout.tsx
import { AssetManagerScript } from 'nextjs-asset-manager'

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        {children}
        <AssetManagerScript />
      </body>
    </html>
  )
}

Start your dev server and:

  • Press Option+Shift+A to toggle the floating panel
  • Click the floating icon button (drag to reposition)
  • Visit /api/asset-manager/ directly in your browser

Configuration

Pass options to createHandler():

import { createHandler } from 'nextjs-asset-manager'

const { GET, POST } = createHandler({
  // Dashboard URL path (must match your route file location)
  base: '/api/asset-manager',

  // Directories to scan
  include: ['app', 'public', 'src'],

  // Directories to exclude
  exclude: ['node_modules', '.git', '.next', 'dist'],

  // Editor for click-to-open: 'code', 'cursor', 'webstorm', 'vim', etc.
  launchEditor: 'code',

  // Path aliases for import detection
  aliases: { '@/': 'src/' },

  // Enable debug logging
  debug: false,
})

export { GET, POST }

Configure the floating icon position:

<AssetManagerScript base="/api/asset-manager" />

How It Works

  • createHandler() — Returns { GET, POST } route handlers that initialize the asset manager, serve the dashboard UI, and handle all API requests through a catch-all route
  • withAssetManager() — Wraps your Next.js config to suppress noisy dev server request logs from the asset manager
  • AssetManagerScript — A 'use client' component that injects the floating icon script in development

The asset manager uses a globalThis singleton (similar to Prisma's pattern) to survive Next.js HMR re-evaluation without losing state.

Requirements

  • Next.js >= 14.0.0
  • React >= 18.0.0
  • Node.js >= 22

Related

License

MIT