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

@bernierllc/media-manager

v1.0.6

Published

Media asset management service with upload, processing, optimization, and CDN integration.

Readme

@bernierllc/media-manager

Media asset management service with upload, processing, optimization, and CDN integration.

Overview

The @bernierllc/media-manager package provides a comprehensive service for managing media assets including images, videos, and documents. It handles upload, processing, optimization, metadata extraction, and CDN distribution with caching and event emission.

Features

  • File Upload: Multipart file uploads with validation and size limits
  • Image Processing: Automatic image optimization and format conversion
  • Metadata Extraction: Extract dimensions, format, and EXIF data from images
  • Storage Integration: Works with Supabase Storage and other backends via @bernierllc/file-handler
  • Caching: Built-in caching for improved performance
  • Event Emission: Emit events for upload, delete, and other operations
  • Search: Search assets by filename, content type, date range, and user

Installation

npm install @bernierllc/media-manager

Usage

import { MediaManager } from '@bernierllc/media-manager';

// Initialize media manager
const mediaManager = new MediaManager({
  supabaseUrl: process.env.SUPABASE_URL,
  supabaseAnonKey: process.env.SUPABASE_ANON_KEY,
  maxFileSize: 10 * 1024 * 1024, // 10MB
  allowedTypes: ['image/*', 'video/*'],
  enableOptimization: true,
  cacheEnabled: true
});

// Initialize (required)
await mediaManager.initialize();

// Upload a file
const uploadResult = await mediaManager.upload({
  file: fileBuffer,
  filename: 'photo.jpg',
  contentType: 'image/jpeg',
  userId: 'user-123',
  optimize: true
});

if (uploadResult.success) {
  console.log('Uploaded:', uploadResult.data?.url);
}

// Get an asset
const assetResult = await mediaManager.getAsset('asset-id');
if (assetResult.success) {
  console.log('Asset:', assetResult.data);
}

// Search assets
const searchResult = await mediaManager.searchAssets({
  contentType: 'image/jpeg',
  uploadedAfter: new Date('2025-01-01'),
  limit: 10
});

// Delete an asset
const deleteResult = await mediaManager.delete('asset-id');

API

MediaManager

Constructor

new MediaManager(config: MediaConfig)

Methods

  • initialize(): Promise<void> - Initialize the media manager (required before use)
  • upload(request: UploadRequest): Promise<MediaResult<MediaAsset>> - Upload a media file
  • getAsset(assetId: string): Promise<MediaResult<MediaAsset>> - Get an asset by ID
  • delete(assetId: string): Promise<MediaResult<void>> - Delete an asset
  • searchAssets(query: MediaQuery): Promise<MediaResult<MediaAsset[]>> - Search for assets
  • process(assetId: string, operations: ImageOperation[]): Promise<MediaResult<MediaAsset>> - Process an asset (not yet implemented)
  • getEventEmitter(): EventEmitter - Get the event emitter for subscribing to events

Integration Status

  • Logger: ✅ Integrated - Uses @bernierllc/logger for all logging operations
  • Docs-Suite: ✅ Ready - Full TypeDoc API documentation available
  • NeverHub: ⚠️ Optional - Can emit media events to NeverHub event bus for distributed observability

Dependencies

  • @bernierllc/logger - Logging
  • @bernierllc/image-processor - Image processing and optimization
  • @bernierllc/supabase-client - Database operations
  • @bernierllc/cache-manager - Caching
  • @bernierllc/event-emitter - Event emission
  • @bernierllc/file-uploader - File upload handling
  • @bernierllc/file-handler - File storage abstraction

Testing

Run tests with:

npm test
npm run test:coverage

Target coverage: 85%+ (service package standard)

License

Copyright (c) 2025 Bernier LLC

This file is licensed to the client under a limited-use license. The client may use and modify this code only within the scope of the project it was delivered for. Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.