# sounds-for-focus

Curated ambient sound catalog (89 sounds across 9 categories), inspired by [Moodist](https://moodist.mvze.net/). Audio files ship inside the npm tarball and are served via [jsDelivr](https://www.jsdelivr.com/) at runtime — keeping consumers (e.g. Figma plugins, web apps) tiny.

## Install

```sh
npm install sounds-for-focus
# or
bun add sounds-for-focus
```

## Usage

```ts
import { SOUNDS, CATEGORIES, getSoundUrl } from "sounds-for-focus";

const rain = SOUNDS.find((s) => s.id === "rain/light-rain")!;
const audio = new Audio(getSoundUrl(rain));
audio.loop = true;
audio.play();
```

`getSoundUrl(sound)` returns a jsDelivr URL pinned to the package version, e.g.
`https://cdn.jsdelivr.net/npm/sounds-for-focus@0.1.0/audio/rain/light-rain.mp3`.

Override the base for self-hosting:

```ts
getSoundUrl(rain, { base: "https://example.com/sounds" });
```

## Categories

`nature`, `rain`, `animals`, `urban`, `places`, `transport`, `things`, `noise`, `binaural`.

## Exports

- `SOUNDS: Sound[]` — full catalog with `{ id, slug, name, emoji, category, path }`.
- `CATEGORIES: CategoryInfo[]` — ordered category metadata.
- `getSoundUrl(sound, opts?)` — build a URL for an audio file.
- `CDN_BASE`, `CDN_ORIGIN` — jsDelivr constants.
- `PACKAGE_NAME`, `PACKAGE_VERSION` — published version (used by `CDN_BASE`).

## License

MIT
