JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q45875F
  • License MIT

Thai astrology ephemeris calculations and utilities for Node.js and TypeScript projects.

Package Exports

  • thai-astrology

Readme

Thai Astrology

Thai Astrology is a TypeScript library that recreates classical Thai astrological calculations. It converts birth details into the 12-channel chart, Tanuseth, planetary positions, and ruling-planet insights without relying on runtime dependencies.

Install

npm install thai-astrology

Usage

import {
  formatChannelOutputs,
  generateThaiAstrologyChart,
} from "thai-astrology"

const chart = generateThaiAstrologyChart({
  day: 15,
  monthTh: "กันยายน",
  yearBe: 2566,
  hour: 14,
  minute: 45,
  province: "กรุงเทพมหานคร",
})

console.log(formatChannelOutputs(chart))
console.log(formatChannelOutputs(chart, "thai"))

Key APIs

  • generateThaiAstrologyChart(input) → returns chart data with optional ruling planets.
  • formatChannelOutputs(chart, options?) → digits in Thai or Arabic numerals.
  • findRulingPlanets(channelOutputs) / formatRulingPlanets(info) → rulership helpers.
  • Planet calculators such as calculateAscendant, calculateSun, etc. for custom flows.
  • calculateAllPositions(input) → raw calculation result before extra metadata.
  • calculateTanuseth(positions, ascSign) → determine Tanuseth directly.
  • Individual calculators: calculateMoon, calculateMars, calculateMercury, calculateJupiter, calculateVenus, calculateSaturn, calculateRahu, calculateKetu, calculateUranus.

Development

npm install
npm run build

Outputs compile to dist/ alongside TypeScript declarations.

License

MIT © Contributors