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/librariesUsage
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
| Entrypoint | Runtime exports | Type exports |
|---|---|---|
@hobenakicoffee/libraries | Re-exports all constants from @hobenakicoffee/libraries/constants | Re-exports all types from @hobenakicoffee/libraries/constants |
@hobenakicoffee/libraries/constants | Visibility, productInfo, companyInfo, PaymentTypes, PaymentStatuses, PaymentProviders, PaymentDirections, SupporterPlatforms, ServiceTypes | Visibility, PaymentType, PaymentStatus, PaymentProvider, PaymentDirection, SupporterPlatform, ServiceType |
Utilities
| Entrypoint | Function exports |
|---|---|
@hobenakicoffee/libraries/utils | checkModeration, formatAmount, formatSignedAmount, formatDate, formatNumber, formatToPlainText, getSocialHandle, getSocialUrl, getUserNameInitials, getUserPageLink, openInNewWindow, shareToFacebook, shareToInstagram, shareToLinkedIn, shareToX, printQrSvg, toHumanReadable, validatePhoneNumber |
Local Development
Install dependencies:
bun installAvailable 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 cleanProject Structure
index.ts