@zuroku/core
v0.1.0
Published
Shared types / HTTP client / image compression for the zuroku publish ecosystem.
Readme
@zuroku/core
Shared primitives for the zuroku publish ecosystem:
ZurokuClient— HTTP client for the publish / list / delete API.compress—sharpwrapper that converts PNG / JPEG to WebP (85% quality, max 2000px long-edge) forzuroku publish --no-compress-less flows.loadConfig/saveConfig— XDG-compliant per-user config (~/.config/zuroku/config.json).ProjectVisibility,SlugManifest,ProjectManifesttypes and error code constants.
Designed to back the @zuroku/cli package. Most end users do not depend on @zuroku/core directly.
Install
npm install @zuroku/coreRequires Node.js 20+.
Quick example
import { ZurokuClient, loadConfig } from '@zuroku/core';
const cfg = await loadConfig();
const client = new ZurokuClient({ baseUrl: cfg.base_url, token: cfg.token });
const projects = await client.listProjects();
console.log(projects);Subpath exports
| Subpath | Purpose |
|---|---|
| @zuroku/core | HTTP client, config IO, compression (Node-only) |
| @zuroku/core/types | Pure type-only re-exports (ProjectVisibility, SlugManifest, ...) |
| @zuroku/core/compress | sharp-based compression helpers (Node-only) |
| @zuroku/core/workers-crypto | Web-Crypto-only HMAC / ULID primitives, safe for Cloudflare Workers |
The workers-crypto subpath does not pull in node:fs / sharp, so it can be imported from Workers runtimes.
License
MIT — see LICENSE.
