support

@cynerad/support

A small TypeScript support toolkit for strings, numbers, dates, HTTP, and common utilities.

<img src="./public/image/logo.png" alt="Project logo" height="400" style={} />

Overview

@cynerad/support is a collection of small, focused helpers for everyday TypeScript work: string formatting, number helpers, dates, HTTP fetch client, cookies, file system helpers, and more.


Features


Installation

# Install from npm
npx shadcn@latest add https://cynerad.github.io/support/public/r/support.json

# install from pnpm
pnpm dlx shadcn@latest add https://cynerad.github.io/support/public/r/support.json

# install from yarn
yarn shadcn@latest add https://cynerad.github.io/support/public/r/support.json

# install from bun
bun x shadcn@latest add https://cynerad.github.io/support/public/r/support.json


Quick Example

import { camel, slug } from "@cynerad/support/string";
import { createFetchClient } from "@cynerad/support/fetch";

// String helpers
camel("hello_world");           // -> "helloWorld"
slug("Hello World!!!");         // -> "hello-world"

// HTTP client
const api = createFetchClient({
  baseUrl: "https://api.example.com",
  headers: { Authorization: "Bearer token" },
});

const users = await api.get<{ id: number; name: string }[]>("/users");

More usage examples live in the docs: example.com/docs.


Testing

This package uses Vitest.

# Run tests (uses "vitest run" under the hood)
pnpm test

# Run Vitest in watch/dev mode
pnpm dev

Scripts (from package.json):


Contributing

By contributing, you agree that your contributions will be licensed under the same MIT License as this project.