sounds-for-focus
v0.1.0
Published
Curated ambient sound catalog.
Downloads
136
Maintainers
Readme
sounds-for-focus
Curated ambient sound catalog (89 sounds across 9 categories), inspired by Moodist. Audio files ship inside the npm tarball and are served via jsDelivr at runtime — keeping consumers (e.g. Figma plugins, web apps) tiny.
Install
npm install sounds-for-focus
# or
bun add sounds-for-focusUsage
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/[email protected]/audio/rain/light-rain.mp3.
Override the base for self-hosting:
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 byCDN_BASE).
License
MIT
