Native Node.js addon that converts Gregorian date/time to Julian Date.
npm install @phothinmaung/julianThe package uses dist/myJulian.node when available. If a compatible prebuilt binary is not present, it falls back to building from source with node-gyp during install.
const julian = require("@phothinmaung/julian");
const jd = julian.gregorianToJulian(2025, 2, 22);
console.log(jd);
const [year, month, day] = julian.julianToGregorian(jd);
console.log(year, month, day);year: numbermonth: number (1-12)day: numberhour: number, default12minutes: number, default0seconds: number, default0tz: timezone offset from UTC in hours, default0
Returns: number (Julian Date)
julianDate: numbertz: timezone offset from UTC in hours, default0
Returns: [year, month, day] as a tuple of numbers
This package contains a native .node binary and source files. If you need to build from source, install:
- Node.js + npm
- Python (required by
node-gyp) - C/C++ build tools (
make,g++on Linux)
Build locally:
npm run build