Getting Started

@cc-heart/utils is a library of JavaScript common tools — the environment-agnostic core of the utils family.

Install

npm install @cc-heart/utils
# or
pnpm add @cc-heart/utils

Usage

import { capitalize } from '@cc-heart/utils'

capitalize('string') // String

What's inside

  • string — capitalize, unCapitalize, ...
  • date — date formatting helpers
  • random — random number / string generators
  • validate — type & value validators
  • promise — async helpers (retry, withTimeout, ...)
  • request — fetch-based HTTP client, see the Request guide
  • sse — Server-Sent Events, see the SSE guide

Try it online

Edit the code below and see results instantly — the demo runs against the published @cc-heart/utils package:

Loading...

API Reference

See the auto-generated API documentation.