Getting Started
This guide will help you get started with @beerush/utils.
Installation
Install the package using your preferred package manager:
bash
npm install @beerush/utilsbash
yarn add @beerush/utilsbash
pnpm add @beerush/utilsbash
bun add @beerush/utilsUsage
After installation, you can import and use the utilities in your project:
typescript
import { toCamelCase } from '@beerush/utils/global'
import { addClass } from '@beerush/utils/client'
console.log(toCamelCase('hello-world')) // helloWorld
addClass(document.body, 'loaded')javascript
const { toCamelCase } = require('@beerush/utils/global')
const { addClass } = require('@beerush/utils/client')
console.log(toCamelCase('hello-world')) // helloWorld
addClass(document.body, 'loaded')Individual Module Imports
You can also import from specific modules:
typescript
import { toCamelCase, toKebabCase } from '@beerush/utils/global/string'
import { addClass, removeClass } from '@beerush/utils/client/dom'Module Overview
The library is organized into three main modules:
- Client (
@beerush/utils/client): Client-side utilities for DOM manipulation, styling, forms, files, clipboard operations, and more - Global (
@beerush/utils/global): Universal utilities for working with strings, numbers, objects, colors, logging, and other base types - Server (
@beerush/utils/server): Server-side utility functions
Each module contains several sub-modules that group related functionality together.