Installation
Pue JS is distributed as a single ESM package with bundled type definitions. It has no runtime dependencies.
Package managers
npm install @puejs/coreWithout a bundler
Pue JS can be loaded directly in the browser as a native ES module:
<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
| Requirement | Detail |
|---|---|
| Runtime | ES2022 and the Web Audio API |
| TypeScript | 5.0 or later (optional, types are bundled) |
| Module format | ESM only |
| Side effects | None — the package is marked "sideEffects": false |
Entry points
| Import path | Contents | Size (gzip) |
|---|---|---|
@puejs/core | Core runtime, presets and their odors | 7.7 kB |
@puejs/core/odors | Seven odors, importable individually | 1.7 – 10.9 kB each |
@puejs/react | React 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.