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

@nvdigitalsolutions/nvoos-storage

v0.1.0-alpha.2

Published

Async storage utilities with Web Worker optimization - Extracted from NV Open Operator System

Readme

@nvdigitalsolutions/nvoos-storage

Async storage utilities with Web Worker optimization for handling large JSON operations without blocking the main thread.

Extracted from: NV Open Operator System (oOS) WordPress Plugin

Why This Package?

This utility was battle-tested in production handling AI chat transcripts in the NV oOS WordPress plugin. It solves the problem of parsing large JSON data (>10KB) without causing browser performance violations.

Real-World Use Case

In NV oOS, AI assistants generate lengthy conversation transcripts that need to be stored in localStorage. Parsing these synchronously was causing frame drops and "Long Tasks" warnings. This package solved that by:

  • Automatically detecting data size
  • Offloading heavy parsing to Web Workers
  • Maintaining backward compatibility with small data (fast sync parsing)
  • Providing graceful fallbacks when workers aren't available

Installation

npm install @nvdigitalsolutions/nvoos-storage

Quick Start

import { StorageUtil } from '@nvdigitalsolutions/nvoos-storage';

// Configure once at app initialization
StorageUtil.configure({
  workerUrl: '/path/to/storage-worker.js',
  sizeThreshold: 10000 // Use worker for data >10KB
});

// Parse large JSON without blocking UI
const transcript = await StorageUtil.parseJSON(largeJsonString);

// Stringify objects asynchronously
const jsonStr = await StorageUtil.stringifyJSON(largeObject);

API

StorageUtil.configure(options)

Configure the utility before first use.

Options:

  • workerUrl (string): Path to your Web Worker script
  • sizeThreshold (number): Byte threshold for using workers (default: 10000)

StorageUtil.parseJSON(jsonString)

Parse JSON asynchronously. Uses worker for large data, sync for small data.

Returns: Promise<any>

StorageUtil.stringifyJSON(obj)

Stringify object to JSON. Uses worker for large objects.

Returns: Promise<string>

StorageUtil.cleanup()

Terminate worker and cleanup resources. Call when done.

Web Worker Setup

Create storage-worker.js:

self.addEventListener('message', function(e) {
  const { action, data, id } = e.data;
  
  try {
    let result;
    if (action === 'parse') {
      result = JSON.parse(data);
    } else if (action === 'stringify') {
      result = JSON.stringify(data);
    }
    
    self.postMessage({ id, success: true, result });
  } catch (error) {
    self.postMessage({ id, success: false, error: error.message });
  }
});

Performance Characteristics

  • Small data (<10KB): Synchronous, ~0.1ms overhead
  • Medium data (10-100KB): Worker, ~5-10ms total
  • Large data (>100KB): Worker, ~50-100ms total

Main thread remains responsive during all operations.

Browser Support

  • Chrome/Edge 113+
  • Firefox 115+
  • Safari 16.4+
  • Any browser with Web Worker support

From WordPress to Universal

This package is extracted from production WordPress plugin code but made framework-agnostic:

  • ❌ Removed: window.wpMcpAiChat configuration
  • ❌ Removed: WordPress-specific console prefixes
  • ✅ Added: Manual configuration method
  • ✅ Added: ES module exports
  • ✅ Added: TypeScript definitions

License

MIT © NV Digital Solutions

Links