npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ponjika

v1.3.0

Published

Bengali ponjika based on gregorian date

Downloads

19

Readme

Ponjika

Bengali(Bangladeshi) ponjika based on Gregorian date.

This package will only work from 2019 and onwards

npm version License: MIT

Live Demo | See the library in action!

Features

  • 🗓️ Convert Gregorian dates to Bengali calendar dates
  • 🌍 Multi-runtime support: Node.js, Browser, Deno, Bun
  • 📦 Zero dependencies
  • 🎯 TypeScript support with full type definitions
  • 🌳 Tree-shakeable ES modules
  • 🔄 Multiple output formats (UMD, ESM, CJS)
  • ⚡ Lightweight and fast

Installation

Node.js / Bun

npm install ponjika

or

yarn add ponjika

or

bun add ponjika

Deno

import { Ponjika } from "npm:ponjika";

or from a CDN:

import { Ponjika } from "https://esm.sh/ponjika";

Browser

Via CDN (UMD)

<script src="https://unpkg.com/ponjika@latest/lib/index.js"></script>
<script>
  const ponjika = new window.ponjika.Ponjika();
  console.log(ponjika.getBengaliDate());
</script>

Via CDN (ES Module)

<script type="module">
  import { Ponjika } from 'https://unpkg.com/ponjika@latest/lib/esm/index.js';

  const ponjika = new Ponjika();
  console.log(ponjika.getBengaliDate());
</script>

Usage

Node.js (CommonJS)

const { Ponjika } = require("ponjika");

const ponjika = new Ponjika(new Date(2024, 3, 14));
console.log(ponjika.getBengaliDate());
// Output: রবিবার, ০১ বৈশাখ ১৪৩১

Node.js / Bun (ES Modules)

import { Ponjika } from "ponjika";

const ponjika = new Ponjika(new Date(2024, 3, 14));
console.log(ponjika.getBengaliDate());
// Output: রবিবার, ০১ বৈশাখ ১৪৩১

TypeScript

import { Ponjika, IPonjika } from "ponjika";

const ponjika = new Ponjika(new Date(2024, 3, 14));
const details: IPonjika = ponjika.getDetails();
console.log(details);

Deno

import { Ponjika } from "npm:ponjika";

const ponjika = new Ponjika(new Date(2024, 3, 14));
console.log(ponjika.getBengaliDate());

Browser

<!DOCTYPE html>
<html>
<head>
  <title>Ponjika Demo</title>
</head>
<body>
  <h1 id="bengali-date"></h1>

  <script src="https://unpkg.com/ponjika@latest/lib/index.js"></script>
  <script>
    const ponjika = new window.ponjika.Ponjika();
    document.getElementById('bengali-date').textContent = ponjika.getBengaliDate();
  </script>
</body>
</html>

Example

import { Ponjika } from "ponjika";

const ponjika = new Ponjika(new Date(2024, 3, 14));

console.log(ponjika.getDetails());

Output:

{
  year: 1431,
  month: 1,
  date: 1,
  bnYear: '১৪৩১',
  bnMonthNo: '০১',
  bnDate: '০১',
  bnMonth: 'বৈশাখ',
  bnDay: 'রবিবার',
  season: 'গ্রীষ্ম',
  bnMonthPhn: 'Boisakh',
  bnDayPhn: 'Robibar',
  seasonPhn: 'Grismo'
}

API Reference

Ponjika Class

Constructor

new Ponjika(date?: Date, bnPrefixZero?: boolean)
  • date (optional): JavaScript Date object. Defaults to current date.
  • bnPrefixZero (optional): Whether to prefix zero to Bengali numerals. Defaults to true.

Methods

getBengaliDate()

Returns a formatted Bengali date string.

ponjika.getBengaliDate();
// Returns: "বৃহস্পতিবার, ০১ বৈশাখ ১৪২৯"
getBengaliPhoneticDate()

Returns a phonetic (English letters) Bengali date string.

ponjika.getBengaliPhoneticDate();
// Returns: "Brihospotibar, 1 Boisakh 1429"
getDateBengaliNumeral()

Returns date components in Bengali numerals.

ponjika.getDateBengaliNumeral();
// Returns: { bnDate: '০১', bnMonth: '০১', bnYear: '১৪২৯' }
getDateNumeral()

Returns date components as numbers.

ponjika.getDateNumeral();
// Returns: { year: 1429, month: 1, date: 1 }
getDetails()

Returns complete information about the Bengali date.

ponjika.getDetails();
// Returns:
// {
//   year: 1429,
//   month: 1,
//   date: 1,
//   bnYear: '১৪২৯',
//   bnMonthNo: '০১',
//   bnDate: '০১',
//   bnMonth: 'বৈশাখ',
//   bnDay: 'বৃহস্পতিবার',
//   season: 'গ্রীষ্ম',
//   bnMonthPhn: 'Boisakh',
//   bnDayPhn: 'Brihospotibar',
//   seasonPhn: 'Grismo'
// }

Utility Functions

enToBnNumber(number, prefixZero?)

Converts English numerals to Bengali numerals.

import { enToBnNumber } from "ponjika";

enToBnNumber(123);        // Returns: "১২৩"
enToBnNumber(5, true);    // Returns: "০৫"
enToBnNumber(5, false);   // Returns: "৫"

Runtime Compatibility

This package is compatible with:

  • Node.js 12+ (CommonJS & ES Modules)
  • Browsers (Modern browsers with ES5+ support)
  • Deno (via npm: specifier or CDN)
  • Bun (native support)
  • TypeScript (full type definitions included)

The package uses conditional exports to provide the optimal bundle for each environment:

  • Browser: UMD build (lib/index.js)
  • Node.js ESM: ES Module build (lib/esm/index.js)
  • Node.js CJS: CommonJS build (lib/cjs/index.js)
  • Deno/Bun: ES Module build (lib/esm/index.js)

TypeScript Interfaces

interface IDateBengaliNumeral {
  bnYear: string;
  bnMonth: string;
  bnDate: string;
}

interface IDateNumeral {
  year: number;
  month: number;
  date: number;
}

interface IPonjika {
  year: number;
  month: number;
  date: number;
  bnYear: string;
  bnMonthNo: string;
  bnDate: string;
  bnMonth: string;
  bnDay: string;
  season: string;
  bnMonthPhn: string;
  bnDayPhn: string;
  seasonPhn: string;
}

Credit

This package is ported from ponjika(go).