Skip to content
0

Services ​

Every service in KatanaKit follows the same architecture: a small public API over a pure core, with the runtime I/O isolated behind it and SSR guards where the browser or Node/Bun is touched. Two public shapes exist, and both are re-exported as use* helpers from the package root:

  • Singleton facade classes — FetchApiManager, DatesService, LoggerService, … expose use* methods and a getInstance() accessor.
  • Function modules with strategies — DOM, storage, theme, viewport, observer and friends ship standalone use* functions; behavior is swapped through strategy objects (for example, LocalStorageStrategy, SessionStorageStrategy and MemoryStorageStrategy behind the storage API).
ts
// Class-based facade
import { FetchApiManager } from "katanakit-js";

const api = FetchApiManager.getInstance();
api.useGetApi("pokeapi", "pokemonById", { params: { id: 25 } });

// Function module — same contract, no instance
import { useGetApi } from "katanakit-js";

useGetApi("pokeapi", "pokemonById", { params: { id: 25 } });

The API Reference is generated from the source; the pages below are the hand-written reference companion: an overview paragraph, a quick example and one section per method with runnable examples.

Core ​

ServiceDescription
HTTP ClientRegister APIs, build URLs and call every HTTP method with Safe Results.
LoggerLog at every level with a small, replaceable logger and table output.
StorageTyped local and session storage with an SSR-safe in-memory fallback.
DOMSSR-safe DOM queries, element creation, attributes, classes and scroll.
ReactiveSignals, effects, memos and toggles for reactive state.
FormatterLocale-aware number, currency and date formatting.
ConverterUnit conversions for temperature, distance and weight.
Error HelpersAttempt, JSON parsing, normalize and serialize for unknown throws.
GeneratorIDs, slugs, tokens and other generated values with zero dependencies.
DatesTemporal-based date math: now, add or subtract days, boundaries.
GeometryArea, perimeter and volume helpers with formatted output.
TimingDelays, intervals, debounce, throttle and retry helpers.
ViewportViewport size, scroll position, media queries and prefers-* state.
ObserverCreate and manage Intersection, Resize and Mutation observers.
WorkerSpawn workers, run functions off-thread and manage worker pools.

Platform ​

ServiceDescription
ThemeDark and light mode with persistence, system preference and DOM sync.
Astro AdapterTyped static paths and service access from Astro pages and endpoints.
RSSBuild RSS endpoints and parse feeds for content channels and embeds.
SEOGenerate HTML head and Open Graph tags from a single flat config.

Integrations ​

ServiceDescription
Nuxt AdapterNuxt composables and server-plugin helpers for the HTTP client.
Vue AdapterVue reactivity wrappers around the HTTP client and query cache.
Express ServerStart an Express server with the toolkit defaults and API config.

Released under the MIT License.