Installation
Install the package and its peer dependency:
npm install @warrenbuckley/audio-visualizer litlit is a peerDependency. If your project already uses Lit, only the first install is needed. The main dist/audio-visualizer.js bundle keeps Lit external so you and the rest of your app share a single copy.
CDN — no install
Section titled “CDN — no install”The package ships a standalone build (audio-visualizer.standalone.js) where Lit is bundled inside (~35 kB / ~11 kB gzip). Drop it into any HTML page — no npm, no bundler, no import map.
jsDelivr
Section titled “jsDelivr”<script type="module" src="https://cdn.jsdelivr.net/npm/@warrenbuckley/audio-visualizer/dist/audio-visualizer.standalone.js"></script><script type="module" src="https://unpkg.com/@warrenbuckley/audio-visualizer/dist/audio-visualizer.standalone.js"></script>esm.sh (resolves Lit automatically)
Section titled “esm.sh (resolves Lit automatically)”esm.sh rewrites bare specifiers at the CDN layer, so you can use the lighter main build (Lit external, ~10 kB) without installing anything:
<script type="module"> import 'https://esm.sh/@warrenbuckley/audio-visualizer';</script>Import map (multiple Lit components)
Section titled “Import map (multiple Lit components)”An import map tells the browser how to resolve bare specifiers, letting you use the main build while sharing one copy of Lit across all components on the page:
<script type="importmap">{ "imports": { "lit": "https://esm.sh/lit@3", "lit/": "https://esm.sh/lit@3/", "@warrenbuckley/audio-visualizer": "https://esm.sh/@warrenbuckley/audio-visualizer" }}</script>
<script type="module"> import '@warrenbuckley/audio-visualizer';</script>The "lit/" entry is a path-prefix mapping that covers all Lit sub-paths in one line. Generate a full version-pinned map (with optional SRI hashes) at generator.jspm.io.