JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q106532F
  • 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-first library that implements traditional Thai astrological calculations. It exposes precise planetary position helpers and rulership utilities derived from the historic algorithms contained in engine/astro-calculation.

Features

  • Compute ascendant, planetary positions, and Tanuseth value from Thai-style inputs.
  • Derive formatted channel outputs that mimic classical Thai charts.
  • Identify ruling planets directly from channel outputs.
  • Zero runtime dependencies and full TypeScript declarations.

Installation

npm install thai-astrology

Quick start

import { generateThaiAstrologyChart } from "thai-astrology"

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

console.log(chart.positions.sun) // 5 => สิงห์
console.log(chart.sunPosition)   // [29, 12]
console.log(chart.rulingPlanetsText)

API surface

The library re-exports the detailed helpers located in engine/astro-calculation as first-class public functions. Key types include:

  • calculateAllPositions(input) → returns CalculationResult with all planetary placements and channel outputs.
  • calculateAscendant(...), calculateSun(...), etc. → granular planet calculators.
  • calculateTanuseth(positions, ascSign) → compute Tanuseth from placements.
  • findRulingPlanets(chart) and formatRulingPlanets(info) → inspect channel strings for rulership insights.
  • generateThaiAstrologyChart(input) → convenience wrapper that augments CalculationResult with optional rulership details.

Refer to the declaration files in dist/ after building for the complete TypeScript surface.

Building locally

npm install
npm run build

A successful build emits compiled JavaScript and declarations into dist/.

License

MIT © Contributors