Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,40 @@
# Dependencies
node_modules/

# Build output
dist/

# IDE
.idea/
.vscode/
*.swp
*.swo

# OS files
.DS_Store
Thumbs.db

# Logs
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Coverage
coverage/
.nyc_output/

# Environment
.env
.env.local
.env.*.local

# Temporary files
tmp/
temp/
*.tmp

# Package locks (keep one)
# Uncomment if you prefer yarn.lock
# package-lock.json
233 changes: 196 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
# BayDinJS

> Myanmar Astrology
> Myanmar Astrology Library for JavaScript

[![code style: prettier][prettier]][prettier-url]
[![npm][npm-download]][npm-dl-url]
[![contributions welcome][contri]][contri-url]
[![License: MIT][license]][license-url]

A JavaScript library for Myanmar traditional astrology calculations including maharbote, numerology, zodiac signs, and more.

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [API Reference](#api-reference)
- [maharbote](#maharboteyear-day)
- [nayNum](#naynumstr)
- [numerology](#numerologynum)
- [numFormat](#numformatnum)
- [tatyout](#tatyoutage-day)
- [chineseZodiac](#chinesezodiacyear)
- [zodiac](#zodiacday-month)
- [Development](#development)
- [Testing](#testing)
- [Contributing](#contributing)
- [License](#license)

## Installation

### via npm
Expand All @@ -15,84 +34,224 @@
npm install --save baydin
```

### via web
### via yarn

```shell
yarn add baydin
```

### via web (CDN)

```html
<script src="https://unpkg.com/baydin@latest/dist/client/baydin.min.js"></script>
```

## Test
## Usage

```shell
npm test
### Node.js

```javascript
const baydin = require("baydin");

// Calculate maharbote
const maharboteResult = baydin.maharbote(1356, 1);
console.log(maharboteResult); // "မရဏ"

// Get numerology number
const numerologyResult = baydin.numerology(11);
console.log(numerologyResult); // 2
```

## Function List
### Browser

- [maharbote](#maharbote)
- [nayNum](#nayNum)
- [numerology](#numerology)
- [numFormat](#numFormat)
- [tatyout](#tatyout)
```html
<script src="https://unpkg.com/baydin@latest/dist/client/baydin.min.js"></script>
<script>
const maharboteResult = baydin.maharbote(1356, 1);
console.log(maharboteResult); // "မရဏ"
</script>
```

## maharbote
## API Reference

ပုတိ ၊ ဘင်္ဂ ၊ မရဏ ၊ အထွန်း ၊ သိုက် ၊ ရာဇာ ၊ အဓိပတိ ဆိုတဲ့ အဖွား ခုနှစ်ခု ကိုတွက်ထုတ်ပေးမှာဖြစ်ပါတယ်။ ခုနှစ် သက္ကရာဇ်ရယ် မွေးနံ ရယ်ကို ထည့်သွင်းဖို့ လိုအပ်ပါတယ်။
### maharbote(year, day)

### Example Code
Calculates the maharbote (astrological influence) based on Myanmar calendar year and birth day of the week.

ပုတိ ၊ ဘင်္ဂ ၊ မရဏ ၊ အထွန်း ၊ သိုက် ၊ ရာဇာ ၊ အဓိပတိ ဆိုတဲ့ အဖွား ခုနှစ်ခု ကိုတွက်ထုတ်ပေးမှာဖြစ်ပါတယ်။

**Parameters:**
- `year` (number): Myanmar calendar year (e.g., 1356)
- `day` (number): Day of the week (1-7, where 1 = Sunday, 7 = Saturday)

**Returns:** (string) The maharbote name in Myanmar

**Example:**
```javascript
var baydin = require("baydin");
var mahb = baydin.maharbote(1356, 1); //မရဏ
baydin.maharbote(1356, 1); // "မရဏ"
```

## nayNum
---

### nayNum(str)

ထည့်သွင်းလိုက်တဲ့ စာသားကို နေ့သင့်နံသင်ဂဏန်းအဖြစ်ပြောင်းမှာဖြစ်ပါတယ်။ ဥပမာ-nayNum("မင်းဖြူမှန်မှန်ပြော")//55555
Converts Myanmar text to its numerological equivalent (nay num).

### Example Code
ထည့်သွင်းလိုက်တဲ့ စာသားကို နေ့သင့်နံသင့်ဂဏန်းအဖြစ်ပြောင်းမှာဖြစ်ပါတယ်။

**Parameters:**
- `str` (string): Myanmar text string

**Returns:** (number) The numerological number

**Example:**
```javascript
var baydin = require("baydin");
var nay = baydin.nayNum("မင်းဖြူမှန်မှန်ပြော"); //55555
baydin.nayNum("မင်းဖြူမှန်မှန်ပြော"); // 55555
```

## numerology
---

### numerology(num)

Calculates the single-digit numerology number from any number.

၁ ဂဏန်း သမား ၂ ဂဏန်း သမား ၉ ဂဏန်းသမား ဆိုပြီးတော့ အမျိုးအစား ၉ မျိုး ရှိပါတယ်။ တွက်နည်းက မွေးရက် ကို တစ်လုံးတည်းရအောင် ပေါင်းရမှာပါ။

၁ ဂဏန်း သမား ၂ ဂဏန်း သမား ၉ ဂဏန်းသမား ဆိုပြီးတော့ အမျိုးအစား ၉ မျိုး ရှိပါတယ်။ တွက်နည်းက မွေးရက် ကို တစ်လုံးတည်းရအောင် ပေါင်းရမှာပါ။ ဥပမာ-၁၁ ဆိုရင် ၂ ဂဏန်းသမားဖြစ်ပါတယ်
**Parameters:**
- `num` (number): Any positive number

### Example Code
**Returns:** (number) Single digit number (1-9)

**Example:**
```javascript
var baydin = require("baydin");
var numero = baydin.numerology(11); //2
baydin.numerology(11); // 2 (1 + 1 = 2)
baydin.numerology(29); // 2 (2 + 9 = 11, 1 + 1 = 2)
```

## numFormat
---

ထည့်သွင်းလိုက်တဲ့ ကိန်းဂဏန်းကို စာသားအနေနဲ့ ပြန်ထုတ်ပေးမှာဖြစ်ပါတယ်။ ဥပမာ-numFormat(152)//တစ်ရာငါးဆယ်နှစ်
### numFormat(num)

### Example Code
Converts a number to Myanmar words.

ထည့်သွင်းလိုက်တဲ့ ကိန်းဂဏန်းကို စာသားအနေနဲ့ ပြန်ထုတ်ပေးမှာဖြစ်ပါတယ်။

**Parameters:**
- `num` (number): Number to convert (supports up to 14 digits)

**Returns:** (string) Number in Myanmar words

**Example:**
```javascript
var baydin = require("baydin");
var numF = baydin.numFormat(152); //တစ်ရာငါးဆယ်နှစ်
baydin.numFormat(152); // "တစ်ရာငါးဆယ်နှစ်"
```

## tatyout
---

### tatyout(age, day)

အသက် နဲ့ နေ့နံ ကို ထည့်သွင်းလိုက်မယ် ဆိုရင် သက်ရောက်ကို တွက်ထုတ်ပေးပါတယ်။ စနေ့အတွက် ကိုတော့ သုည မဟုတ်ပဲ 7 ကိုပဲထည့်သွင်းပေးစေလိုပါတယ်။ ဥပမာ-သက်ရောက်(1,1)//1 လို့ တွက်ထုတ်ပေးပါတယ်။
Calculates the tatyout (life influence) based on age and birth day of the week.

### Example Code
အသက် နဲ့ နေ့နံ ကို ထည့်သွင်းလိုက်မယ် ဆိုရင် သက်ရောက်ကို တွက်ထုတ်ပေးပါတယ်။

**Parameters:**
- `age` (number): Age in years
- `day` (number): Day of the week (1-7, where 7 = Saturday)

Copilot AI Feb 15, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation for the day parameter is inconsistent with the maharbote function. The maharbote function documentation specifies "1 = Sunday, 7 = Saturday" to clarify the day numbering system, but the tatyout function only specifies "where 7 = Saturday". For consistency and clarity, consider changing this to "Day of the week (1-7, where 1 = Sunday, 7 = Saturday)" to match the pattern used in maharbote documentation on line 85.

Suggested change
- `day` (number): Day of the week (1-7, where 7 = Saturday)
- `day` (number): Day of the week (1-7, where 1 = Sunday, 7 = Saturday)

Copilot uses AI. Check for mistakes.

**Returns:** (number) The tatyout number (1-7)

**Example:**
```javascript
var baydin = require("baydin");
var ty = baydin.tatyout(1, 1); //1
baydin.tatyout(1, 1); // 1
```

---

### chineseZodiac(year)

Gets the Chinese zodiac sign for a given year.

**Parameters:**
- `year` (number): Gregorian calendar year (positive integer)

**Returns:** (Object) Object containing `sign` (English) and `signInBurmese` (Myanmar)

**Example:**
```javascript
baydin.chineseZodiac(2024);
// { sign: "Dragon", signInBurmese: "နဂါး" }
```

---

### zodiac(day, month)

Gets the Western zodiac sign based on birth date.

**Parameters:**
- `day` (number): Day of birth (1-31)
- `month` (number): Month of birth (1-12)

**Returns:** (Object) Object containing `sign` (English) and `sign_mm` (Myanmar)

**Throws:** Error if invalid date or month input

**Example:**
```javascript
baydin.zodiac(15, 3);
// { sign: "Pisces", sign_mm: "မိန်" }
```

## Development

### Prerequisites

- Node.js (v14 or higher recommended)

Copilot AI Feb 15, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README states "Node.js (v14 or higher recommended)" but the package.json specifies "node": ">=12.0.0". These should be consistent. Either update the README to say v12 or higher, or update package.json to require >= 14.0.0 if v14 is truly the recommended minimum. Note that Number.isInteger and Number.isFinite are available in Node.js 0.12+, so v12 should work, but the documentation should match the actual requirement.

Suggested change
- Node.js (v14 or higher recommended)
- Node.js (v12 or higher)

Copilot uses AI. Check for mistakes.
- npm or yarn

### Setup

```shell
git clone https://github.com/AungMyoKyaw/BayDin.git
cd BayDin
npm install
```

### Build

```shell
npm run build
```

This will create:
- `dist/node/` - Node.js compatible build
- `dist/client/` - Browser compatible minified build

## Testing

```shell
npm test
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'feat: add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

Please make sure to update tests as appropriate and follow the existing code style.

## License

MIT © [Aung Myo Kyaw](https://github.com/AungMyoKyaw)
MIT License - see the [LICENSE](LICENSE) file for details.

## Author

Aung Myo Kyaw - [GitHub](https://github.com/AungMyoKyaw)

[contri]: https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat-square
[contri-url]: https://github.com/AungMyoKyaw/BayDin/issues
Expand Down
Loading