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

@fritill/nuxt-media-library

v0.0.38

Published

Nuxt module for media library management — chunked uploads, asset previews, and resource policies

Readme

Media Library

npm version npm downloads License Nuxt

Media library components and upload utilities for Nuxt, Vue, and custom elements.

Features

  • ⛰  Foo
  • 🚠  Bar
  • 🌲  Baz

Quick Setup

Install the module to your Nuxt application with one command:

npx nuxi module add media-library

That's it! You can now use Media Library in your Nuxt app ✨

Usage

Nuxt installation (Vue components only)

export default defineNuxtConfig({
  modules: ['media-library'],
  mediaLibrary: {
    // Auto-register Vue components from src/runtime/components
    components: true,
    // Chunk uploader config (used by MlFileUpload)
    baseURL: 'https://api.example.com',
    // Uploads always go through Nuxt server (/api/media-library/uploads/*)
    routes: {
      createSession: '/uploads/sessions',
      getSession: '/uploads/sessions/:id',
      uploadPart: '/uploads/sessions/:id/parts/:part',
      finalize: '/uploads/sessions/:id/finalize',
      abort: '/uploads/sessions/:id/abort',
    },
    partSize: 8 * 1024 * 1024,
    concurrency: 3,
    checksum: { algorithm: 'SHA-256', perPart: true, final: true },
    headers: {},
  },
})

Nuxt usage

<template>
  <MediaLibrary />
</template>

If you use the uploader component in Nuxt, provide config via the Nuxt plugin (see your module/plugin setup) and use:

<template>
  <MlFileUpload />
</template>

Vue installation (non-Nuxt)

npm i media-library
import { createApp } from 'vue'
import MediaLibraryPlugin from 'media-library/vue'

const app = createApp(App)
app.use(MediaLibraryPlugin, {
  chunkUploader: {
    // Use a same-origin proxy (recommended) or set baseURL for direct calls
    baseURL: '',
    routes: {
      createSession: '/api/media-library/uploads/sessions',
      getSession: '/api/media-library/uploads/sessions/:id',
      uploadPart: '/api/media-library/uploads/sessions/:id/parts/:part',
      finalize: '/api/media-library/uploads/sessions/:id/finalize',
    },
    partSize: 8 * 1024 * 1024,
    concurrency: 3,
    checksum: { algorithm: 'SHA-256', perPart: true, final: true },
    headers: {},
  },
})
<template>
  <MediaLibrary />
  <MlFileUpload />
</template>

Custom element via CDN

Load the prebuilt custom element bundle (IIFE):

<script src="/dist-ce/media-library.custom-element.js"></script>
<media-library></media-library>
<ml-file-upload></ml-file-upload>

Global config:

<script>
  window.MediaLibraryConfig = {
    chunkUploader: {
      baseURL: '',
      routes: {
        createSession: '/api/media-library/uploads/sessions',
        getSession: '/api/media-library/uploads/sessions/:id',
        uploadPart: '/api/media-library/uploads/sessions/:id/parts/:part',
        finalize: '/api/media-library/uploads/sessions/:id/finalize',
      },
      partSize: 8388608,
      concurrency: 3,
      checksum: { algorithm: 'SHA-256', perPart: true, final: true },
      headers: {},
    }
  }
</script>

Per element:

<ml-file-upload
  chunk-uploader='{"baseURL":"","routes":{"createSession":"/api/media-library/uploads/sessions","getSession":"/api/media-library/uploads/sessions/:id","uploadPart":"/api/media-library/uploads/sessions/:id/parts/:part","finalize":"/api/media-library/uploads/sessions/:id/finalize"},"partSize":8388608,"concurrency":3,"checksum":{"algorithm":"SHA-256","perPart":true,"final":true},"headers":{}}'
></ml-file-upload>

Developer Guide

Nuxt development (module)

# Install dependencies
npm install

# Generate type stubs and prepare the playground
npm run dev:prepare

# Run the playground (Nuxt module usage)
npm run dev

Use the playground to test module options and auto-registered components.

SSR notes (Nuxt)

If a component uses browser-only APIs, use one of these patterns:

if (process.client) {
  // window/document usage
}
import { onMounted } from 'vue'

onMounted(() => {
  // safe to access window/document here
})
<ClientOnly>
  <MediaLibrary />
</ClientOnly>

Or make it client-only by naming the file MyComponent.client.vue.

Vue development (library)

# Build the Vue entry and type declarations
npm run prepack

Import from media-library/vue in a Vue app to verify component behavior.

Custom element development (CE)

# Build the standalone custom element bundle
npm run build:custom-element

Load dist-ce/media-library.custom-element.js in any HTML page and use <media-library></media-library> to verify the output.

Tests

npm run lint
npm run test
npm run test:watch
npm run test:types