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

@fusionstrings/swisseph-wasm

v0.1.5

Published

High-precision Swiss Ephemeris bindings for WebAssembly (Rust based)

Downloads

527

Readme

swisseph-wasm 🌌

High-precision, WebAssembly bindings for the Swiss Ephemeris.

  • 🚀 Best-in-Class: Faster, smaller, and more accurate than pure JS implementations.
  • 🛡️ Safe: Rust-based memory safety for FFI interactions.
  • 📦 Universal: Works in Node.js, Deno, Bun, and Browsers.

JSR npm Crates.io CI

Features

  • Full Swiss Ephemeris: Wraps the complete C library (v2.10.03).
  • Zero Dependencies: Generated WASM has no external runtime deps.
  • Type-Safe: Complete TypeScript definitions.
  • Isomorphic: Runs everywhere WebAssembly runs.

⚡ Benchmarks

1. Complex Calculations (e.g. Moon Position)

When precision matters, swisseph-wasm is both faster and more accurate.

| Environment | swisseph-wasm | astronomy-engine | Comparison | | :--------------- | :------------------ | :--------------- | :------------------ | | Deno (Bench) | ~182,000 iter/s | ~126,000 iter/s | 1.44x Faster 🚀 |

2. Simple Calculations (e.g. Sun Position)

For simple calculations, the overhead of calling WebAssembly dominates. Pure JS is faster here.

| Environment | swisseph-wasm | astronomy-engine | Note | | :------------------- | :--------------- | :------------------- | :---------------------- | | Browser (Chrome) | ~319,000 ops/sec | ~577,000 ops/sec | Inlined WASM vs Pure JS | | Deno (Native) | ~178,000 ops/sec | ~434,000 ops/sec | Default Loader |

Summary: Use swisseph-wasm for professional-grade astrology (precision + complex speed). Use astronomy-engine for UI/visualizations (low precision + simple speed).

Run them yourself:

deno task bench
deno run -A benches/deno_throughput.ts
# For browser: Serve root and open benches/browser_bench.html

Installation

Deno / JSR

deno add jsr:@fusionstrings/swisseph-wasm

Rust (Cargo)

Use as a native Rust crate:

cargo add swisseph-wasm

Advanced: Import raw WASM (Deno):

import wasmBytes from "@fusionstrings/swisseph-wasm/wasm";
const module = new WebAssembly.Module(wasmBytes);

NPM / Node.js

npm install @fusionstrings/swisseph-wasm

Browser (Zero-Config)

Use the bundled browser version (inlined WASM) directly:

import { swe_julday } from "@fusionstrings/swisseph-wasm/browser";
// WASM initializes automatically

Quick Start

import {
  SE_GREG_CAL,
  SE_MOON,
  SE_SUN,
  swe_calc_ut,
  swe_julday,
} from "@fusionstrings/swisseph-wasm";

// 1. Calculate Julian Day for Jan 1, 2000, 12:00 UTC
const jd = swe_julday(2000, 1, 1, 12.0, SE_GREG_CAL);
console.log(`Julian Day: ${jd}`); // 2451545.0

// 2. Calculate Sun Position
const sun = swe_calc_ut(jd, SE_SUN, 0);
console.log("Sun Longitude:", sun.longitude);

// 3. Calculate Moon Position
const moon = swe_calc_ut(jd, SE_MOON, 0);
console.log("Moon Longitude:", moon.longitude);

Building from Source

Prerequisites

  • Rust: rustup target add wasm32-unknown-unknown
  • Deno: For task management.
  • LLVM: Required for compiling the C library to WASM.

macOS Users:

brew install llvm

Build Command

The build script automatically detects Homebrew LLVM.

deno task build

Maintenance

Version Management

To update the version across Deno, Cargo, and NPM configs:

deno task bump-version <new-version>
# Example: deno task bump-version 1.2.3

This command validates the version format, updates all config files, and syncs Cargo.lock.

License

MIT License. Based on the Swiss Ephemeris (GPL/Commercial dual license). Note: Using this library implies compliance with the Swiss Ephemeris license terms.