Playground

Setup & Usage

Learn how to install and use @hobenakicoffee/libraries

Framework-agnostic shared constants and utilities for "হবে নাকি Coffee?" projects.

Installation

npm install @hobenakicoffee/libraries
# or
pnpm add @hobenakicoffee/libraries
# or
yarn add @hobenakicoffee/libraries
# or
bun add @hobenakicoffee/libraries

Usage

This package exposes three entry points:

  • @hobenakicoffee/libraries (re-exports constants)
  • @hobenakicoffee/libraries/constants
  • @hobenakicoffee/libraries/utils

Examples

import { PaymentStatuses, ServiceTypes } from "@hobenakicoffee/libraries";

import { SupporterPlatforms } from "@hobenakicoffee/libraries/constants";

import {
  formatAmount,
  formatDate,
  getUserPageLink,
} from "@hobenakicoffee/libraries/utils";

API at a Glance

Constants and Types

EntrypointRuntime exportsType exports
@hobenakicoffee/librariesRe-exports all constants from @hobenakicoffee/libraries/constantsRe-exports all types from @hobenakicoffee/libraries/constants
@hobenakicoffee/libraries/constantsVisibility, productInfo, companyInfo, PaymentTypes, PaymentStatuses, PaymentProviders, PaymentDirections, SupporterPlatforms, ServiceTypesVisibility, PaymentType, PaymentStatus, PaymentProvider, PaymentDirection, SupporterPlatform, ServiceType

Utilities

EntrypointFunction exports
@hobenakicoffee/libraries/utilscheckModeration, formatAmount, formatSignedAmount, formatDate, formatNumber, formatToPlainText, getSocialHandle, getSocialUrl, getUserNameInitials, getUserPageLink, openInNewWindow, shareToFacebook, shareToInstagram, shareToLinkedIn, shareToX, printQrSvg, toHumanReadable, validatePhoneNumber

Local Development

Install dependencies:

bun install

Available scripts:

# Build the library
bun run build

# Run in watch mode during development
bun run dev

# Run tests
bun run test

# Run tests in watch mode
bun run test:watch

# Run type checking
bun run typecheck

# Alias for typecheck
bun run lint

# Clean build artifacts
bun run clean

Project Structure

index.ts

On this page