{"_id":"@astrologer/astro-core","_rev":"2-aeab5c2f965c4001e001a35614562cbe","name":"@astrologer/astro-core","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@astrologer/astro-core","version":"1.0.0","_id":"@astrologer/astro-core@1.0.0","maintainers":[{"name":"astronaughty","email":"astronaughty@astrologer.com.br"}],"dist":{"shasum":"33020795e391dbb6f6b78b19ee074f284627312c","tarball":"https://registry.npmjs.org/@astrologer/astro-core/-/astro-core-1.0.0.tgz","fileCount":95,"integrity":"sha512-INhkCzmRNkNfIOLqJgeUhCMM4fvRj2br8ErReGn4yGGaEuwXrS7vRbcQip9rQzlGL6NrC7PMYomyqw5jrVN1Cg==","signatures":[{"sig":"MEQCIG0O6u9Bqg/GOYuqElUXK+y04RjvbIeCt5wG/QqRDIWmAiAThb7hbSrpRZDxUUFKvnx436cacgBjXd6w9YZoKrGUXw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":246318},"main":"dist/index.js","type":"module","_from":"file:astrologer-astro-core-1.0.0.tgz","types":"dist/index.d.ts","scripts":{"test":"vitest run","build":"tsc"},"_npmUser":{"name":"astronaughty","email":"astronaughty@astrologer.com.br"},"_resolved":"/private/var/folders/89/rr48tk552d912vdwq39bd3bw0000gn/T/4c389eb0482dacb70ce4a2d8bbe55653/astrologer-astro-core-1.0.0.tgz","_integrity":"sha512-INhkCzmRNkNfIOLqJgeUhCMM4fvRj2br8ErReGn4yGGaEuwXrS7vRbcQip9rQzlGL6NrC7PMYomyqw5jrVN1Cg==","_npmVersion":"10.9.4","description":"A **functional**, high-precision astrological calculation library powered by Swiss Ephemeris. This library provides pure functions for calculating charts, analyzing relationships, and generating ephemerides.","directories":{},"_nodeVersion":"22.21.1","dependencies":{"luxon":"^3.7.2","@swisseph/core":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.16","typescript":"^5.9.3","@types/node":"^25.0.3","@types/luxon":"^3.7.1","@swisseph/node":"^1.2.0","@swisseph/browser":"^1.1.0"},"peerDependencies":{"@swisseph/node":"^1.2.0","@swisseph/browser":"^1.1.0"},"peerDependenciesMeta":{"@swisseph/node":{"optional":true},"@swisseph/browser":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/astro-core_1.0.0_1769774624324_0.6849929638281511","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@astrologer/astro-core","version":"1.0.1","type":"module","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/intellecat/AstroCore.git","directory":"packages/core"},"dependencies":{"@swisseph/core":"^1.1.0","luxon":"^3.7.2"},"peerDependencies":{"@swisseph/browser":"^1.1.0","@swisseph/node":"^1.2.0"},"peerDependenciesMeta":{"@swisseph/node":{"optional":true},"@swisseph/browser":{"optional":true}},"devDependencies":{"@swisseph/browser":"^1.1.0","@swisseph/node":"^1.2.0","@types/luxon":"^3.7.1","@types/node":"^25.0.3","typescript":"^5.9.3","vitest":"^4.0.16"},"scripts":{"build":"tsc","test":"vitest run"},"_id":"@astrologer/astro-core@1.0.1","description":"A **functional**, high-precision astrological calculation library powered by Swiss Ephemeris. This library provides pure functions for calculating charts, analyzing relationships, and generating ephemerides.","bugs":{"url":"https://github.com/intellecat/AstroCore/issues"},"homepage":"https://github.com/intellecat/AstroCore#readme","_integrity":"sha512-5MvcOfXd6+xfHLioVvKvrD5l4HGQWH/+MdBWF97WlfZNvSqn2nK91UFEzyIq0WjRwXV9q7IKCdXetLV7ZA/wKw==","_resolved":"/tmp/d97c5a978da5692c9a103f8568546d05/astrologer-astro-core-1.0.1.tgz","_from":"file:astrologer-astro-core-1.0.1.tgz","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-5MvcOfXd6+xfHLioVvKvrD5l4HGQWH/+MdBWF97WlfZNvSqn2nK91UFEzyIq0WjRwXV9q7IKCdXetLV7ZA/wKw==","shasum":"e6d622ca3b39d248f5dccbf9b39b165e0d222a41","tarball":"https://registry.npmjs.org/@astrologer/astro-core/-/astro-core-1.0.1.tgz","fileCount":57,"unpackedSize":128933,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@astrologer%2fastro-core@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCUupbbx6hF3ZMc2nxY+2kxhm6XsP5U+BWrHAJwO5r3SQIhAPrKM+9rnHZ3K0j+TqaC6cFwvmZFehXMRLPDpeqi+V6q"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:5bdbe9d0-0893-46b0-b0e7-a4526d880e0e"}},"directories":{},"maintainers":[{"name":"astronaughty","email":"astronaughty@astrologer.com.br"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/astro-core_1.0.1_1770117180707_0.990389675744427"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-30T12:03:44.234Z","modified":"2026-02-03T11:13:01.174Z","1.0.0":"2026-01-30T12:03:44.457Z","1.0.1":"2026-02-03T11:13:00.873Z"},"description":"A **functional**, high-precision astrological calculation library powered by Swiss Ephemeris. This library provides pure functions for calculating charts, analyzing relationships, and generating ephemerides.","maintainers":[{"name":"astronaughty","email":"astronaughty@astrologer.com.br"}],"readme":"# @astrologer/astro-core\n\nA **functional**, high-precision astrological calculation library powered by Swiss Ephemeris. This library provides pure functions for calculating charts, analyzing relationships, and generating ephemerides.\n\n## Philosophy\n\n- **Functional:** All functions are pure and stateless. Inputs -> Outputs.\n- **Precision:** Uses `@swisseph/core` for astronomical accuracy.\n- **Type-Safe:** First-class TypeScript support with comprehensive types.\n\n## Installation\n\n```bash\npnpm install @astrologer/astro-core\n```\n\n## Initialization\n\nBefore performing any calculations, you must initialize the library with the appropriate Swiss Ephemeris adapter.\n\n### Node.js\n```typescript\nimport { setSwissEphemeris } from '@astrologer/astro-core';\nimport * as swe from '@swisseph/node';\n\n// Initialize with the Node.js adapter\nsetSwissEphemeris(swe);\n```\n\n### Browser\n```typescript\nimport { setSwissEphemeris } from '@astrologer/astro-core';\nimport { SwissEphemeris } from '@swisseph/browser';\n\nconst swe = new SwissEphemeris();\nawait swe.init(); // WASM initialization\nsetSwissEphemeris(swe);\n```\n\n## Main API\n\n### `calculateChart(input: ChartInput): ChartData`\nThe primary entry point. Calculates a complete astrological chart snapshot.\n\n```typescript\nimport { calculateChart } from '@astrologer/astro-core';\n\nconst chart = calculateChart({\n  date: '2026-01-01T12:00:00Z',\n  location: { latitude: 40.7, longitude: -74.0 }\n});\n```\n\n## Core Functions\n\nThese functions are used internally by `calculateChart` but can be used independently for granular control.\n\n### Planets & Points\n- **`calculatePlanets(jd, houses, angles, flags?, bodies?)`**: Calculates positions for specified bodies.\n- **`calculateLunarPhase(sunLon, moonLon)`**: Returns moon phase, illumination, and age.\n- **`getBodyPosition(body, jd, flags?)`**: Low-level wrapper for Swiss Ephemeris position.\n\n### Houses & Angles\n- **`calculateHousesAndAngles(jd, lat, lng, system)`**: Returns house cusps (1-12) and angles (Asc, MC, Vertex, etc).\n- **`getHouses(jd, lat, lng, system)`**: Low-level wrapper for Swiss Ephemeris houses.\n\n### Aspects\n- **`calculateAspects(bodies)`**: Finds all major aspects between a list of bodies.\n- **`calculateDualAspects(bodiesA, bodiesB)`**: Finds aspects between two different sets of bodies (Synastry/Transit).\n- **`getAspect(body1, body2)`**: Checks if two specific bodies form an aspect.\n\n## Advanced Charts\n\n### Synastry & Relationships\n- **`calculateCompositeChart(dateA, locA, dateB, locB)`**: Calculates a midpoint composite chart.\n- **`calculateRelationshipScore(chartA, chartB)`**: (Analysis) Returns a compatibility score based on synastry aspects.\n\n### Forecasting\n- **`calculateSolarReturn(birthDate, returnYear, location)`**: Calculates the exact moment of the Solar Return.\n- **`calculateLunarReturn(birthDate, returnDate, location)`**: Calculates the Lunar Return.\n- **`generateEphemerisRange(input)`**: Generates a time-series of chart data over a date range.\n\n### Analysis\n- **`calculateElementDistribution(bodies)`**: Returns the count/percentage of planets in Fire, Earth, Air, Water.\n- **`calculateQualityDistribution(bodies)`**: Returns the count/percentage of planets in Cardinal, Fixed, Mutable.\n- **`calculatePolarityDistribution(bodies)`**: Returns the count/percentage of planets in Yin (Feminine) vs Yang (Masculine).\n\n## Utilities\n\n- **`getJulianDay(date)`**: Converts string/Date/DateTime to Julian Day Number.\n- **`findNextEclipse(date, type)`**: Finds the next Solar or Lunar eclipse.\n- **`configureSidereal(mode)`**: Sets the global sidereal mode (e.g., Fagan-Bradley, Lahiri).\n- **`configureTopocentric(location)`**: Sets the global topocentric observer location.\n\n## Types & Enums\n\nImport these to ensure type safety in your application.\n\n```typescript\nimport { \n  BodyId,       // Sun, Moon, Mercury...\n  HouseSystem,  // Placidus, Koch, WholeSign...\n  AspectType,   // Conjunction, Square...\n  ZodiacType    // Tropical, Sidereal\n} from '@astrologer/astro-core';\n```","readmeFilename":"README.md","homepage":"https://github.com/intellecat/AstroCore#readme","repository":{"type":"git","url":"git+https://github.com/intellecat/AstroCore.git","directory":"packages/core"},"bugs":{"url":"https://github.com/intellecat/AstroCore/issues"}}