Documentation menu

Installation

Pue JS is distributed as a single ESM package with bundled type definitions. It has no runtime dependencies.

Package managers

npm install @puejs/core

Without a bundler

Pue JS can be loaded directly in the browser as a native ES module:

HTML
<script type="module">  import { createEmitter } from "https://cdn.jsdelivr.net/npm/@puejs/core/+esm";   const emitter = createEmitter(window);  document.addEventListener("pointerdown", () => emitter.start(), { once: true });</script>

Requirements

RequirementDetail
RuntimeES2022 and the Web Audio API
TypeScript5.0 or later (optional, types are bundled)
Module formatESM only
Side effectsNone — the package is marked "sideEffects": false

Entry points

Import pathContentsSize (gzip)
@puejs/coreCore runtime, presets and their odors7.7 kB
@puejs/core/odorsSeven odors, importable individually1.7 – 10.9 kB each
@puejs/reactReact adapter: usePue, PueProvider (separate package)1.4 kB

Server-side rendering

Importing Pue JS on the server is safe: the package performs no work at import time. On the server, createEmitter returns an inert emitter whose methods are no-ops. In frameworks that distinguish client and server components, such as the Next.js App Router, instantiate emitters inside a client component.