Vedākṣha

Integration Guide — WASM Browser

Full computation. Zero server.

The Vedākṣha WASM module runs the same Rust computation engine in any modern browser. No backend required. No user data leaves the device. Dashas, nakshatras, house cusps, and aspects work instantly — full planetary positions require the DE440s ephemeris file loaded alongside the module.

Try it live at vedaksha.net/playground — no install required.

Installation

npmterminal
npm add vedaksha-wasm
pnpmterminal
pnpm add vedaksha-wasm
yarnterminal
yarn add vedaksha-wasm

Loading the WASM Module

chart.js
import init, {
  calendar_to_jd,
  compute_dasha,
  get_nakshatra,
  compute_houses,
  find_aspects,
  compute_ayanamsha,
} from "vedaksha-wasm";

// initialise the WASM module once at app start
await init();

// ── functions that need NO ephemeris file ──────────────────────────────

const jd = calendar_to_jd(1990, 6, 15, 10.5);
// → 2448057.9375  (Julian Day)

const nakshatra = get_nakshatra(45.23);
// → { name: "Rohini", pada: 2, lord: "Moon" }

const dasha = compute_dasha(jd, /*moon_longitude=*/ 45.23);
// → full DashaTree from birth to present + 20 years

const ayanamsha = compute_ayanamsha(jd, "Lahiri");
// → 23.6712  (degrees)

const houses = compute_houses(
  /*sidereal_time=*/ 6.42,   // hours
  /*latitude=*/     28.6139, // degrees
  /*system=*/       "Placidus"
);
// → { cusps: [0°, 32.1°, 64.8°, ...], ascendant: 32.1° }

const aspects = find_aspects(
  [{ id: "Sun", longitude: 45.2 }, { id: "Moon", longitude: 135.8 }],
  { major_only: true }
);
// → [{ from: "Sun", to: "Moon", type: "Square", orb: 0.6, applying: false }]

Loading Ephemeris Data (Full Chart Computation)

For full planetary positions, fetch the DE440s file (17 MB, covers 1550–2650 CE) and pass it to the module before calling compute_chart.

full-chart.js
import init, { load_ephemeris, compute_chart } from "vedaksha-wasm";

await init();

// Fetch DE440s — 17 MB, covers 1550–2650 CE
// Host this from your CDN or use the Vedākṣha CDN endpoint
const ephemResponse = await fetch("/static/de440s.bin");
const ephemData     = await ephemResponse.arrayBuffer();
load_ephemeris(new Uint8Array(ephemData));

// Now compute_chart is available
const jd    = calendar_to_jd(1990, 6, 15, 10.5);
const chart = compute_chart(jd, 28.6139, 77.2090, {
  house_system: "Placidus",
  ayanamsha:    "Lahiri",
});

// chart.planets → all bodies with longitude, speed, nakshatra, dignity
// chart.houses  → all 12 cusps
// chart.yogas   → detected Vedic yogas
// chart.graph   → the full ChartGraph

What Works Without Ephemeris Data

These functions are fully self-contained. They work immediately afterawait init()with no additional data loading.

compute_dasha(julian_day_of_birth, moon_longitude)

Compute the full Vimshottari dasha tree from the Moon's natal longitude. No planetary data file required — the calculation is purely algorithmic.

get_nakshatra(moon_longitude)

Return the nakshatra and pada for any ecliptic longitude. Instant — divides the zodiac geometrically.

compute_houses(sidereal_time, latitude, system)

Compute all 12 house cusps for any house system using the local sidereal time and geographic latitude. Does not need planetary positions.

find_aspects(positions[], orbs?)

Detect all aspects among an array of longitudes you supply. The engine applies orb logic and returns typed Aspect objects.

compute_ayanamsha(julian_day, system)

Return the ayanamsha value for any of the 44 supported systems at any Julian Day. Fully self-contained calculation.

calendar_to_jd(year, month, day, hour_ut)

Convert a proleptic Gregorian calendar date and UT hour to a Julian Day number. Zero dependencies.

What Needs Ephemeris Data

These functions require load_ephemeris() to be called first.

compute_chart

Full natal chart with planetary longitudes, latitudes, distances, and speeds. Requires DE440s (17 MB) or DE440 (117 MB) ephemeris file loaded into WASM memory.

search_transits

Exact transit moment search over a date range. Requires iterative planetary position computation — needs ephemeris data.

compute_vargas

Divisional charts require accurate planetary longitudes as input — which in turn require ephemeris data.

Interactive Playground

Try every WASM function in the browser at vedaksha.net/playground. No install, no account. The playground loads the DE440s ephemeris and exposes a live console where you can call any function and inspect the output.

Open playground →