my-julian
v0.0.2
Published
NodeJs c++ addon for Julian Date
Readme
NodeJs c++ addon for Julian Date
Native Node.js addon that converts Gregorian date/time to Julian Date.
Install
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.
Usage
const julian = require("@phothinmaung/julian");
const jd = julian.gregorianToJulian(2025, 2, 22);
console.log(jd);API
gregorianToJulian(year, month, day, hour?, minutes?, seconds?, tz?)
year: numbermonth: number (1-12)day: numberhour: number, default12minutes: number, default0seconds: number, default0tz: timezone offset from UTC in hours, default0
Returns: number (Julian Date)
Build requirements (from source)
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