{"id":49901108,"url":"https://github.com/hobenakicoffee/libraries","last_synced_at":"2026-05-26T06:07:21.564Z","repository":{"id":354347307,"uuid":"1140895882","full_name":"hobenakicoffee/libraries","owner":"hobenakicoffee","description":"Necessary public libraries for \"হবে নাকি Coffee?\" projects. Framework-agnostic and reusable.","archived":false,"fork":false,"pushed_at":"2026-05-24T01:10:50.000Z","size":718,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-24T01:22:20.117Z","etag":null,"topics":["bun","library","package","typescript","utility-library"],"latest_commit_sha":null,"homepage":"https://developer.hobenakicoffee.com/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hobenakicoffee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-01-23T22:32:29.000Z","updated_at":"2026-05-24T01:10:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/hobenakicoffee/libraries","commit_stats":null,"previous_names":["hobenakicoffee/libraries"],"tags_count":48,"template":false,"template_full_name":null,"purl":"pkg:github/hobenakicoffee/libraries","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobenakicoffee%2Flibraries","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobenakicoffee%2Flibraries/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobenakicoffee%2Flibraries/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobenakicoffee%2Flibraries/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hobenakicoffee","download_url":"https://codeload.github.com/hobenakicoffee/libraries/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobenakicoffee%2Flibraries/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33419558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T22:14:44.296Z","status":"online","status_checked_at":"2026-05-24T02:00:06.296Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bun","library","package","typescript","utility-library"],"created_at":"2026-05-16T06:24:56.591Z","updated_at":"2026-05-26T06:07:21.531Z","avatar_url":"https://github.com/hobenakicoffee.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @hobenakicoffee/libraries\n\nFramework-agnostic shared constants, utilities, types, and moderation tools for \"হবে নাকি Coffee?\" projects.\n**Version: 4.1.1**\n\n![GitHub Stars](https://www.shieldcn.dev/github/stars/hobenakicoffee/libraries.svg?variant=secondary\u0026size=sm)\n![GitHub Forks](https://www.shieldcn.dev/github/forks/hobenakicoffee/libraries.svg?variant=secondary\u0026size=sm)\n![Watchers](https://www.shieldcn.dev/github/watchers/hobenakicoffee/libraries.svg?variant=secondary\u0026size=sm)\n![Branches](https://www.shieldcn.dev/github/branches/hobenakicoffee/libraries.svg?variant=ghost\u0026size=sm)\n![Contributors](https://www.shieldcn.dev/github/contributors/hobenakicoffee/libraries.svg?theme=emerald\u0026size=sm)\n![Last commit](https://www.shieldcn.dev/github/last-commit/hobenakicoffee/libraries.svg?variant=secondary\u0026size=sm)\n![Commits](https://www.shieldcn.dev/github/commits/hobenakicoffee/libraries.svg?variant=secondary\u0026size=sm)\n![Open issues](https://www.shieldcn.dev/github/open-issues/hobenakicoffee/libraries.svg?variant=secondary\u0026size=sm)\n![Closed issues](https://www.shieldcn.dev/github/closed-issues/hobenakicoffee/libraries.svg?variant=ghost\u0026size=sm)\n![Open PRs](https://www.shieldcn.dev/github/open-prs/hobenakicoffee/libraries.svg?variant=secondary\u0026size=sm)\n![Closed PRs](https://www.shieldcn.dev/github/closed-prs/hobenakicoffee/libraries.svg?variant=ghost\u0026size=sm)\n![Merged PRs](https://www.shieldcn.dev/github/merged-prs/hobenakicoffee/libraries.svg?variant=ghost\u0026size=sm)\n![Release](https://www.shieldcn.dev/github/release/hobenakicoffee/libraries.svg?size=sm)\n![CI](https://www.shieldcn.dev/github/ci/hobenakicoffee/libraries.svg?variant=secondary\u0026size=sm)\n![License](https://www.shieldcn.dev/github/license/hobenakicoffee/libraries.svg?variant=ghost\u0026size=sm)\n![npm Version](https://www.shieldcn.dev/npm/@hobenakicoffee/libraries.svg?variant=secondary\u0026size=sm)\n![npm Weekly Downloads](https://www.shieldcn.dev/npm/dw/@hobenakicoffee/libraries.svg?size=sm)\n![npm Monthly Downloads](https://www.shieldcn.dev/npm/dm/@hobenakicoffee/libraries.svg?variant=ghost\u0026size=sm)\n![npm Total Downloads](https://www.shieldcn.dev/npm/dt/@hobenakicoffee/libraries.svg?variant=secondary\u0026size=sm)\n![npm Dependents](https://www.shieldcn.dev/npm/dependents/@hobenakicoffee/libraries.svg?variant=secondary\u0026size=sm)\n![npm Types](https://www.shieldcn.dev/npm/types/@hobenakicoffee/libraries.svg?theme=blue\u0026size=sm)\n![npm Node](https://www.shieldcn.dev/npm/node/@hobenakicoffee/libraries.svg?variant=secondary\u0026size=sm)\n![npm License](https://www.shieldcn.dev/npm/license/@hobenakicoffee/libraries.svg?variant=ghost\u0026size=sm)\n![Package mgr · Bun](https://www.shieldcn.dev/badge/Package_mgr-Bun-000000.svg?logo=bun\u0026variant=branded\u0026size=sm)\n![Language · TypeScript](https://www.shieldcn.dev/badge/Language-TypeScript-3178C6.svg?logo=typescript\u0026variant=branded\u0026size=sm)\n![Bundler · Vite](https://www.shieldcn.dev/badge/Bundler-Vite-646CFF.svg?logo=vite\u0026variant=branded\u0026size=sm)\n![OpenAI](https://www.shieldcn.dev/badge/Stack-OpenAI-412991.svg?logo=openai\u0026variant=branded\u0026size=sm)\n![React](https://www.shieldcn.dev/badge/Stack-React-61DAFB.svg?logo=react\u0026variant=branded\u0026size=sm)\n![Tailwind CSS](https://www.shieldcn.dev/badge/Stack-Tailwind_CSS-06B6D4.svg?logo=tailwindcss\u0026variant=branded\u0026size=sm)\n![Zod](https://www.shieldcn.dev/badge/Stack-Zod-3E67B1.svg?logo=zod\u0026variant=branded\u0026size=sm)\n![Biome](https://www.shieldcn.dev/badge/Stack-Biome-60A5FA.svg?logo=biome\u0026variant=branded\u0026size=sm)\n![VitePress](https://www.shieldcn.dev/badge/Stack-VitePress-5E72E4.svg?logo=vitepress\u0026variant=branded\u0026size=sm)\n![ESM only](https://www.shieldcn.dev/badge/ESM-only-16a34a.svg?variant=secondary\u0026size=sm)\n![Agent-friendly AGENTS.md](https://www.shieldcn.dev/badge/Agent--friendly-AGENTS.md-D97757.svg?variant=secondary\u0026size=sm)\n\n## Installation\n\n```bash\nnpm install @hobenakicoffee/libraries\n# or\npnpm add @hobenakicoffee/libraries\n# or\nyarn add @hobenakicoffee/libraries\n# or\nbun add @hobenakicoffee/libraries\n```\n\n## Usage\n\nThis package exposes multiple entry points:\n\n```ts\n// Main entry - constants\nimport { PaymentStatuses, ServiceTypes, Visibility } from \"@hobenakicoffee/libraries\";\n\n// Constants only\nimport { SupporterPlatforms } from \"@hobenakicoffee/libraries/constants\";\n\n// Utilities only\nimport { formatAmount, formatDate, getUserPageLink } from \"@hobenakicoffee/libraries/utils\";\n\n// Types only\nimport type { Database, Tables } from \"@hobenakicoffee/libraries/types\";\n\n// Moderation tools\nimport { containsProfanity, containsBanglaSwear } from \"@hobenakicoffee/libraries/moderation\";\n\n// URL state management\nimport { parseAsSortOrder } from \"@hobenakicoffee/libraries/nuqs\";\n\n// Scripts\nimport { checkEnvEncryption } from \"@hobenakicoffee/libraries/scripts\";\n\n// Hooks\nimport { useIsMobile } from \"@hobenakicoffee/libraries/hooks\";\n```\n\n## Entry Points Overview\n\n| Entrypoint | Description |\n| ---------- | ----------- |\n| `@hobenakicoffee/libraries` | Main entry - re-exports constants |\n| `@hobenakicoffee/libraries/constants` | All constants |\n| `@hobenakicoffee/libraries/utils` | Utility functions |\n| `@hobenakicoffee/libraries/types` | TypeScript types (custom + Supabase) |\n| `@hobenakicoffee/libraries/moderation` | Content moderation tools |\n| `@hobenakicoffee/libraries/nuqs` | URL state management parsers |\n| `@hobenakicoffee/libraries/scripts` | Build/utility scripts |\n| `@hobenakicoffee/libraries/hooks` | React hooks |\n\n---\n\n## Constants (`@hobenakicoffee/libraries/constants`)\n\n### Visibility\n\n```ts\nimport { Visibility } from \"@hobenakicoffee/libraries\";\n\nVisibility.PUBLIC  // \"public\"\nVisibility.PRIVATE // \"private\"\n```\n\n### productInfo\n\nProduct metadata for \"হবে নাকি Coffee?\":\n\n```ts\nimport { productInfo } from \"@hobenakicoffee/libraries\";\n\nproductInfo.name        // \"হবে নাকি Coffee?\"\nproductInfo.domain      // \"https://www.hobenakicoffee.com\"\nproductInfo.twitterHandle // \"@hobenakicoffee\"\nproductInfo.title       // Platform tagline\nproductInfo.description // Full description\nproductInfo.keywords    // SEO keywords\nproductInfo.socials     // Social media links object\n```\n\n### companyInfo\n\nCompany contact and legal information:\n\n```ts\nimport { companyInfo } from \"@hobenakicoffee/libraries\";\n\ncompanyInfo.name           // \"Shamscorner LLC\"\ncompanyInfo.contactEmail   // \"mail@shamscorner.com\"\ncompanyInfo.contactPhone   // \"+1(817) 973-7285\"\ncompanyInfo.contactLocation // Full address\ncompanyInfo.domain         // \"https://www.shamscorner.com\"\ncompanyInfo.postalAddress  // Postal address object\n```\n\n### Payment Constants\n\n```ts\nimport { PaymentTypes, PaymentStatuses, PaymentProviders, PaymentDirections, PayoutProviders, WithdrawalStatuses } from \"@hobenakicoffee/libraries\";\n\n// Payment Types\nPaymentTypes.SUBSCRIPTION       // \"subscription\"\nPaymentTypes.ONE_TIME           // \"one-time\"\nPaymentTypes.PAYOUT             // \"payout\"\nPaymentTypes.WITHDRAW_LOCK      // \"withdraw_lock\"\nPaymentTypes.WITHDRAW_RELEASE   // \"withdraw_release\"\nPaymentTypes.WITHDRAW_COMPLETE // \"withdraw_complete\"\nPaymentTypes.MANUAL_ADJUSTMENT  // \"manual_adjustment\"\n\n// Payment Statuses\nPaymentStatuses.PENDING      // \"pending\"\nPaymentStatuses.PROCESSING  // \"processing\"\nPaymentStatuses.COMPLETED   // \"completed\"\nPaymentStatuses.FAILED      // \"failed\"\nPaymentStatuses.REVERSED    // \"reversed\"\nPaymentStatuses.CANCELLED   // \"cancelled\"\nPaymentStatuses.REFUNDED     // \"refunded\"\nPaymentStatuses.REVIEWING    // \"reviewing\"\n\n// Payment Providers\nPaymentProviders.HOBENAKICOFFEE // \"HobeNakiCoffee\"\nPaymentProviders.BKASH         // \"Bkash\"\nPaymentProviders.NAGAD         // \"Nagad\"\nPaymentProviders.ROCKET        // \"Rocket\"\nPaymentProviders.UPAY          // \"Upay\"\nPaymentProviders.SSLCOMMERZ    // \"SSLCommerz\"\nPaymentProviders.AAMARPAY      // \"Aamarpay\"\nPaymentProviders.PORTWALLET    // \"Portwallet\"\nPaymentProviders.TAP           // \"Tap\"\nPaymentProviders.OTHER         // \"Other\"\n\n// Payment Directions\nPaymentDirections.DEBIT  // \"debit\"\nPaymentDirections.CREDIT // \"credit\"\n\n// Payout Providers\nPayoutProviders.BKASH   // \"bkash\"\nPayoutProviders.NAGAD   // \"nagad\"\nPayoutProviders.ROCKET // \"rocket\"\nPayoutProviders.BANK   // \"bank\"\n\n// Withdrawal Statuses\nWithdrawalStatuses.REQUESTED  // \"requested\"\nWithdrawalStatuses.APPROVED   // \"approved\"\nWithdrawalStatuses.PROCESSING // \"processing\"\nWithdrawalStatuses.PAID       // \"paid\"\nWithdrawalStatuses.REJECTED   // \"rejected\"\nWithdrawalStatuses.FAILED     // \"failed\"\n```\n\n### Supporter Platforms\n\n```ts\nimport { SupporterPlatforms } from \"@hobenakicoffee/libraries\";\n\nSupporterPlatforms.FACEBOOK   // \"facebook\"\nSupporterPlatforms.X          // \"x\"\nSupporterPlatforms.INSTAGRAM  // \"instagram\"\nSupporterPlatforms.YOUTUBE   // \"youtube\"\nSupporterPlatforms.GITHUB     // \"github\"\nSupporterPlatforms.LINKEDIN  // \"linkedin\"\nSupporterPlatforms.TWITCH     // \"twitch\"\nSupporterPlatforms.TIKTOK     // \"tiktok\"\nSupporterPlatforms.THREADS    // \"threads\"\nSupporterPlatforms.WHATSAPP   // \"whatsapp\"\nSupporterPlatforms.TELEGRAM   // \"telegram\"\nSupporterPlatforms.DISCORD    // \"discord\"\nSupporterPlatforms.REDDIT     // \"reddit\"\nSupporterPlatforms.PINTEREST  // \"pinterest\"\nSupporterPlatformS.MEDIUM     // \"medium\"\nSupporterPlatformS.DEVTO      // \"devto\"\nSupporterPlatformS.BEHANCE    // \"behance\"\nSupporterPlatformS.DRIBBBLE   // \"dribbble\"\n```\n\n### Service Types\n\n```ts\nimport { ServiceTypes } from \"@hobenakicoffee/libraries\";\n\nServiceTypes.GIFT              // \"gift\"\nServiceTypes.EXCLUSIVE_CONTENT // \"exclusive_content\"\nServiceTypes.WITHDRAWAL        // \"withdrawal\"\nServiceTypes.FOLLOW            // \"follow\"\n```\n\n---\n\n## Utilities (`@hobenakicoffee/libraries/utils`)\n\n### formatAmount\n\nFormats a number as Bangladeshi Taka (৳).\n\n```ts\nimport { formatAmount, formatSignedAmount } from \"@hobenakicoffee/libraries/utils\";\n\nformatAmount(1000);    // \"৳1,000\"\nformatAmount(-500);    // \"৳500\" (absolute value)\n\n// With direction sign\nformatSignedAmount(1000, \"credit\");  // \"+ ৳1,000\"\nformatSignedAmount(500, \"debit\");   // \"- ৳500\"\n```\n\n### formatCount\n\nFormats a count with appropriate suffixes (K, M, B).\n\n```ts\nimport { formatCount } from \"@hobenakicoffee/libraries/utils\";\n\nformatCount(500);    // \"500\"\nformatCount(1000);   // \"1K\"\nformatCount(1500000); // \"1.5M\"\n```\n\n### formatDate\n\nFormats a date string to a readable format.\n\n```ts\nimport { formatDate } from \"@hobenakicoffee/libraries/utils\";\n\nformatDate(\"2024-01-15T00:00:00Z\"); // \"Jan 15, 2024\"\nformatDate(\"invalid\");                // \"-\"\n```\n\n### formatNumber\n\nFormats a number with thousand separators.\n\n```ts\nimport { formatNumber } from \"@hobenakicoffee/libraries/utils\";\n\nformatNumber(1000000); // \"1,000,000\"\n```\n\n### formatToPlainText\n\nConverts various data types to plain text.\n\n```ts\nimport { formatToPlainText, formatMetadataKey } from \"@hobenakicoffee/libraries/utils\";\n\n// Basic usage\nformatToPlainText(\"hello\");           // \"hello\"\nformatToPlainText(123);              // \"123\"\nformatToPlainText(true);             // \"Yes\"\nformatToPlainText(false);            // \"No\"\n\n// With options\nformatToPlainText(\"some long text...\", { maxStringLength: 10 });\n// \"some lo...\"\n\nformatToPlainText({ key: \"value\" });\n// JSON stringified\n\nformatMetadataKey(\"supporterName\");  // \"Supporter Name\"\nformatMetadataKey(\"is_monthly\");     // \"Is monthly\"\n```\n\n### getUserPageLink\n\nGenerates a user profile page URL.\n\n```ts\nimport { getUserPageLink } from \"@hobenakicoffee/libraries/utils\";\n\ngetUserPageLink(\"johndoe\");\n// \"https://hobenakicoffee.com/@johndoe\"\n\ngetUserPageLink(\"johndoe\", \"https://custom.com\");\n// \"https://custom.com/@johndoe\"\n```\n\n### getProductLink\n\nGenerates a product page URL.\n\n```ts\nimport { getProductLink } from \"@hobenakicoffee/libraries/utils\";\n\ngetProductLink(\"johndoe\", \"my-product\");\n// \"https://hobenakicoffee.com/@johndoe/shop/products/my-product\"\n\ngetProductLink(\"johndoe\", \"my-product\", \"https://custom.com\");\n// \"https://custom.com/@johndoe/shop/products/my-product\"\n```\n\n### getNewsletterPostLink\n\nGenerates a newsletter post URL.\n\n```ts\nimport { getNewsletterPostLink } from \"@hobenakicoffee/libraries/utils\";\n\ngetNewsletterPostLink(\"johndoe\", \"my-post\");\n// \"/@johndoe/posts/my-post\"\n\ngetNewsletterPostLink(\"johndoe\", \"my-post\", \"https://hobenakicoffee.com\");\n// \"https://hobenakicoffee.com/@johndoe/posts/my-post\"\n```\n\n### getUserNameInitials\n\nExtracts initials from a name.\n\n```ts\nimport { getInitials } from \"@hobenakicoffee/libraries/utils\";\n\ngetInitials(\"John Doe\");      // \"JD\"\ngetInitials(\"John\");          // \"J\"\ngetInitials(\"John Michael\");  // \"JM\"\ngetInitials(null);            // \"?\"\n```\n\n### getSocialLink\n\nGenerates social media profile URLs.\n\n```ts\nimport { getSocialLink, SupporterPlatforms } from \"@hobenakicoffee/libraries\";\n\ngetSocialLink(\"johndoe\", SupporterPlatforms.FACEBOOK);\n// \"https://facebook.com/johndoe\"\n\ngetSocialLink(\"johndoe\", SupporterPlatforms.INSTAGRAM);\n// \"https://instagram.com/johndoe\"\n\ngetSocialLink(\"johndoe\", SupporterPlatforms.GITHUB);\n// \"https://github.com/johndoe\"\n```\n\n### getSocialHandle\n\nExtracts the handle/username from a social media URL.\n\n```ts\nimport { getSocialHandle } from \"@hobenakicoffee/libraries/utils\";\n\ngetSocialHandle(\"https://twitter.com/johndoe\"); // \"johndoe\"\ngetSocialHandle(\"@johndoe\");                     // \"johndoe\"\ngetSocialHandle(\"johndoe\");                     // \"johndoe\"\n```\n\n### openInNewWindow\n\nOpens a URL in a new tab safely.\n\n```ts\nimport { openInNewWindow } from \"@hobenakicoffee/libraries/utils\";\n\nopenInNewWindow(\"https://example.com\");\n// Opens in new tab with rel=\"noopener noreferrer\"\n```\n\n### Social Sharing Functions\n\n```ts\nimport { shareToFacebook, shareToInstagram, shareToLinkedIn, shareToX } from \"@hobenakicoffee/libraries/utils\";\n\n// Facebook\nshareToFacebook({\n  url: \"https://example.com\",\n  quote: \"Check this out!\",\n  hashtag: \"coffee\",\n  ref: \"campaign123\"\n});\n\n// Instagram (uses Web Share API or copies to clipboard)\nshareToInstagram({\n  url: \"https://example.com\",\n  text: \"Check this out!\"\n});\n\n// LinkedIn\nshareToLinkedIn({\n  url: \"https://example.com\",\n  title: \"My Title\",\n  summary: \"Description here\",\n  source: \"HobeNakiCoffee\"\n});\n\n// X (Twitter)\nshareToX({\n  text: \"Hello from HobeNakiCoffee!\",\n  url: \"https://example.com\",\n  hashtags: \"coffee,support\",\n  via: \"hobenakicoffee\"\n});\n```\n\n### QR Code Utilities\n\n```ts\nimport { downloadQrSvgAsPng, printQrSvg } from \"@hobenakicoffee/libraries/utils\";\n\n// Download QR as PNG\nawait downloadQrSvgAsPng(\n  '\u003csvg\u003e...\u003c/svg\u003e',\n  \"qr-code.png\",\n  () =\u003e console.log(\"Success\"),\n  () =\u003e console.log(\"Error\")\n);\n\n// Print QR\nprintQrSvg(\n  '\u003csvg\u003e...\u003c/svg\u003e',\n  \"QR Code Print\",\n  () =\u003e console.log(\"Error\")\n);\n```\n\n### toHumanReadable\n\nConverts camelCase or snake_case strings to human-readable format.\n\n```ts\nimport { toHumanReadable } from \"@hobenakicoffee/libraries/utils\";\n\ntoHumanReadable(\"camelCase\");       // \"Camel Case\"\ntoHumanReadable(\"snake_case\");      // \"Snake Case\"\ntoHumanReadable(\"CONSTANT_VALUE\");  // \"CONSTANT VALUE\"\ntoHumanReadable(\"HTTPResponseCode\"); // \"HTTP Response Code\"\n```\n\n### validatePhoneNumber\n\nValidates Bangladeshi mobile phone numbers.\n\n```ts\nimport { validatePhoneNumber } from \"@hobenakicoffee/libraries/utils\";\n\nvalidatePhoneNumber(\"01712345678\");  // true\nvalidatePhoneNumber(\"+8801712345678\"); // true\nvalidatePhoneNumber(\"8801712345678\");  // true\nvalidatePhoneNumber(\"01512345678\");   // false (invalid prefix)\nvalidatePhoneNumber(\"1234567890\");    // false\n```\n\n### checkModeration\n\nChecks text for profanity using both local Bangla word lists and OpenAI moderation API.\n\n```ts\nimport { checkModeration } from \"@hobenakicoffee/libraries/utils\";\nimport OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst result = await checkModeration(openai, \"some text to check\");\n\nresult.flagged      // boolean - true if content is flagged\nresult.categories   // OpenAI categories if flagged\nresult.source      // \"profanity\" | \"openai\" | null\nresult.profaneWords // Array of matched profanity words (if from profanity check)\nresult.error        // Error if any\n```\n\n---\n\n## Moderation (`@hobenakicoffee/libraries/moderation`)\n\n### containsProfanity / containsBanglaSwear\n\nLocal profanity detection for English and Bangla.\n\n```ts\nimport { containsProfanity, containsBanglaSwear, badwordsMatcher } from \"@hobenakicoffee/libraries/moderation\";\n\nconst hasProfanity = containsProfanity(\"some bad word here\");\nconst hasBanglaProfanity = containsBanglaSwear(\"কিছু খারাপ শব্দ\");\n```\n\n---\n\n## Types (`@hobenakicoffee/libraries/types`)\n\nFull Supabase database types with Row, Insert, and Update types for each table.\n\n```ts\nimport type { Database, Tables, TablesInsert, TablesUpdate, Enums } from \"@hobenakicoffee/libraries/types\";\n\n// Database type\ntype DB = Database;\n\n// Table row types\ntype Profile = Tables\u003c\"profiles\"\u003e;\ntype Transaction = Tables\u003c\"transactions\"\u003e;\ntype Supporter = Tables\u003c\"supporters\"\u003e;\n\n// Insert types\ntype NewProfile = TablesInsert\u003c\"profiles\"\u003e;\ntype NewTransaction = TablesInsert\u003c\"transactions\"\u003e;\n\n// Update types\ntype ProfileUpdate = TablesUpdate\u003c\"profiles\"\u003e;\n\n// Enum types\ntype PaymentStatus = Enums\u003c\"payment_status_enum\"\u003e;\ntype SupporterPlatform = Enums\u003c\"supporter_platform_enum\"\u003e;\n```\n\n### Custom Types\n\nThe library also exports custom types for common data structures:\n\n```ts\nimport type { TransactionMetadata, ActivityMetadata, SupportersMetadata } from \"@hobenakicoffee/libraries/types\";\n```\n\n---\n\n## Nuqs (`@hobenakicoffee/libraries/nuqs`)\n\nURL state management parsers using nuqs and zod.\n\n```ts\nimport { parseAsSortOrder, parseAsDateRange, parseAsLastTimeRange } from \"@hobenakicoffee/libraries/nuqs\";\n\n// Sort order\nparseAsSortOrder.parse(\"asc\"); // \"asc\"\nparseAsSortOrder.parse(\"invalid\"); // throws\n\n// Date range\nparseAsDateRange.parse({ from: new Date(), to: new Date() });\n\n// Last time range\nparseAsLastTimeRange.parse(\"last_7_days\");\nparseAsLastTimeRange.parse(\"last_30_days\");\nparseAsLastTimeRange.parse(\"last_90_days\");\nparseAsLastTimeRange.parse(\"last_180_days\");\nparseAsLastTimeRange.parse(\"last_year\");\n```\n\n---\n\n## Hooks\n\n### useIsMobile\n\nReact hook to detect if the viewport is mobile-sized.\n\n```ts\nimport { useIsMobile } from \"@hobenakicoffee/libraries/hooks\";\n\nfunction MyComponent() {\n  const isMobile = useIsMobile();\n  \n  return \u003cdiv\u003e{isMobile ? \"Mobile\" : \"Desktop\"}\u003c/div\u003e;\n}\n```\n\n---\n\n## API Reference\n\n### Constants\n\n| Export | Type | Description |\n|--------|------|-------------|\n| `Visibility` | `object` | PUBLIC, PRIVATE constants |\n| `Visibility` | `type` | Type for visibility values |\n| `productInfo` | `object` | Product metadata |\n| `companyInfo` | `object` | Company information |\n| `PaymentTypes` | `object` | Payment type constants |\n| `PaymentType` | `type` | Type for payment types |\n| `PaymentStatuses` | `object` | Payment status constants |\n| `PaymentStatus` | `type` | Type for payment statuses |\n| `PaymentProviders` | `object` | Payment provider constants |\n| `PaymentProvider` | `type` | Type for payment providers |\n| `PaymentDirections` | `object` | Payment direction constants |\n| `PaymentDirection` | `type` | Type for payment directions |\n| `PayoutProviders` | `object` | Payout provider constants |\n| `PayoutProvider` | `type` | Type for payout providers |\n| `WithdrawalStatuses` | `object` | Withdrawal status constants |\n| `WithdrawalStatus` | `type` | Type for withdrawal statuses |\n| `SupporterPlatforms` | `object` | Social platform constants |\n| `SupporterPlatform` | `type` | Type for supporter platforms |\n| `ServiceTypes` | `object` | Service type constants |\n| `ServiceType` | `type` | Type for service types |\n\n### Utilities\n\n| Function | Description |\n|----------|-------------|\n| `formatAmount` | Format number as ৳ currency |\n| `formatSignedAmount` | Format with + or - sign |\n| `formatCount` | Format count with K, M, B suffixes |\n| `formatDate` | Format date string |\n| `formatNumber` | Format with thousand separators |\n| `formatToPlainText` | Convert value to plain text |\n| `formatMetadataKey` | Format metadata key to readable text |\n| `getUserPageLink` | Generate user profile URL |\n| `getProductLink` | Generate product page URL |\n| `getNewsletterPostLink` | Generate newsletter post URL |\n| `getInitials` | Get name initials |\n| `getSocialLink` | Generate social profile URL |\n| `getSocialHandle` | Extract handle from social URL |\n| `openToNewWindow` | Open URL in new tab |\n| `postToFacebook` | Share to Facebook |\n| `postToInstagram` | Share to Instagram |\n| `postToLinkedIn` | Share to LinkedIn |\n| `postToX` | Share to X (Twitter) |\n| `downloadQrSvgAsPng` | Download QR as PNG |\n| `printQrSvg` | Print QR code |\n| `toHumanReadable` | Convert camelCase/snake_case to readable |\n| `validatePhoneNumber` | Validate Bangladeshi phone |\n| `checkModeration` | Check text for profanity |\n\n### Moderation\n\n| Function | Description |\n|----------|-------------|\n| `containsProfanity` | Check text for profanity (English + Bangla) |\n| `containsBanglaSwear` | Check text for Bangla profanity |\n| `badwordsMatcher` | English profanity matcher (obscenity) |\n| `banglaBadWords` | Bangla profanity word list |\n\n---\n\n## Local Development\n\nInstall dependencies:\n\n```bash\nbun install\n```\n\nAvailable scripts:\n\n```bash\n# Build the library\nbun run build\n\n# Run in watch mode during development\nbun run dev\n\n# Run tests\nbun run test\n\n# Run tests in watch mode\nbun run test:watch\n\n# Run type checking\nbun run typecheck\n\n# Alias for typecheck\nbun run lint\n\n# Format code\nbun run format\n\n# Check formatting\nbun run format:check\n\n# Check formatting issues\nbun run format:doctor\n\n# Clean build artifacts\nbun run clean\n```\n\n---\n\n## Project Structure\n\n```\nsrc/\n├── index.ts                 # Main entry (re-exports constants)\n├── constants/\n│   ├── common.ts           # Visibility\n│   ├── legal.ts            # productInfo, companyInfo\n│   ├── payment.ts          # Payment constants\n│   ├── platforms.ts        # SupporterPlatforms\n│   ├── services.ts         # ServiceTypes\n│   └── index.ts            # Exports\n├── utils/\n│   ├── check-moderation.ts\n│   ├── format-amount.ts\n│   ├── format-count.ts\n│   ├── format-date.ts\n│   ├── format-number.ts\n│   ├── format-plain-text.ts\n│   ├── get-newsletter-post-link.ts\n│   ├── get-product-link.ts\n│   ├── get-social-handle.ts\n│   ├── get-social-link.ts\n│   ├── get-user-name-initials.ts\n│   ├── get-user-page-link.ts\n│   ├── open-to-new-window.ts\n│   ├── post-to-facebook.ts\n│   ├── post-to-instagram.ts\n│   ├── post-to-linkedin.ts\n│   ├── post-to-x.ts\n│   ├── qr-svg-utils.ts\n│   ├── to-human-readable.ts\n│   ├── validate-phone-number.ts\n│   └── index.ts            # Exports\n├── moderation/\n│   ├── datasets/\n│   │   ├── bn.ts           # Bangla bad words\n│   │   └── index.ts\n│   ├── profanity-service.ts\n│   └── index.ts            # Exports\n├── types/\n│   ├── supabase.ts         # Full Supabase types\n│   └── index.ts            # Exports + custom types\n├── nuqs/\n│   ├── common.ts           # URL state parsers\n│   └── index.ts            # Exports\n├── hooks/\n│   └── use-mobile.ts       # Mobile detection hook\n└── scripts/\n    ├── check-env-encryption.ts\n    └── index.ts            # Exports\n```\n\n---\n\n## Dependencies\n\n### Runtime\n\n- `@fontsource-variable/noto-sans-bengali` - Bengali font\n- `class-variance-authority` - Component variants\n- `clsx` - Class name utility\n- `nuqs` - URL state management\n- `obscenity` - Profanity detection\n- `openai` - OpenAI API\n- `react` / `react-dom` - React\n- `tailwind-merge` - Tailwind merge\n- `tailwindcss` - Styling\n- `tw-animate-css` - Animations\n- `zod` - Schema validation\n\n### Dev\n\n- `@biomejs/biome` - Linting/formatting\n- `ultracite` - Ultracite CLI\n- `vite` - Build tool\n\n---\n\n## Release \u0026 Publish\n\nPublishing is automated on push to the `main` branch via GitHub Actions. Ensure:\n\n- `package.json` version is updated.\n- `NPM_TOKEN` secret is configured with publish permissions.\n\nFor local publish (if needed):\n\n```bash\nnpm publish --access public\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhobenakicoffee%2Flibraries","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhobenakicoffee%2Flibraries","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhobenakicoffee%2Flibraries/lists"}