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

nuxt-cos

v2.0.2

Published

Nuxt module to load shared dependencies from Cross-Origin Storage

Readme

nuxt-cos

[!WARNING] Experimental. The Cross-Origin Storage API is an early-stage proposal with no native browser support yet, and the underlying chunk format is not stable. Do not depend on it in production.

A Nuxt module that loads shared dependencies (such as vue) from Cross-Origin Storage (COS). It extracts those dependencies into content-addressed chunks so that a COS-capable browser can reuse the same chunk across different sites instead of downloading it once per origin.

It is a thin Nuxt wrapper around vite-plugin-cross-origin-storage; see that package for how the content addressing and sharing work.

Setup

npx nuxt module add nuxt-cos

Or add it manually:

// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-cos'],
})

By default it manages vue and @vue/*. The module only runs in production builds (it is a no-op in dev), and it injects the COS loader into the server-rendered HTML, replacing Nuxt's default entry script.

Configuration

export default defineNuxtConfig({
  modules: ['nuxt-cos'],
  cos: {
    // Packages to extract into COS chunks. Matched against the imported
    // specifier; a plain string is an exact match. Transitive dependencies
    // are collected automatically.
    packages: [/^(?:vue$|@vue\/)/],
  },
})

| Option | Type | Default | Description | | --- | --- | --- | --- | | packages | Array<string \| RegExp> | [/^(?:vue$\|@vue\/)/] | Packages to extract into COS chunks. |

Trying it out

The module is a no-op in dev, so test a production build:

nuxt build && nuxt preview

What to look for:

  • In .output/public/_nuxt/, the managed packages are emitted as content-hashed chunks (64-character hex filenames like a1b2c3...e4f5.js).
  • View source on the rendered page: Nuxt's default entry <script type="module"> is gone, replaced by a <script id="cos-loader"> containing the loader and an inlined manifest.
  • The page still hydrates and is interactive.

Without a COS-capable browser the loader fetches each chunk over the network (the fallback path), so this confirms the chunking and loader work, but not sharing.

To see real Cross-Origin Storage, install the extension, open the preview URL once (the chunks are fetched and stored), then reload or open another site shipping the same Vue version: in DevTools -> Network the hashed chunks are served from the shared store instead of refetched.

For local testing it's safest to load the extension unpacked from web-ai-community/cross-origin-storage-extension.

Browser support

The Cross-Origin Storage API is not yet in any browser. You can try it with the Cross-Origin Storage browser extension. Without it, chunks load over the network as usual, so your site keeps working; it just doesn't share them.

License

MIT