sweph 2.10.0-10 → 2.10.0-11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/binding.gyp CHANGED
@@ -14,7 +14,8 @@
14
14
  "swisseph"
15
15
  ],
16
16
  "defines": [
17
- "NAPI_DISABLE_CPP_EXCEPTIONS"
17
+ "NAPI_DISABLE_CPP_EXCEPTIONS",
18
+ 'NAPI_VERSION=6'
18
19
  ]
19
20
  },
20
21
  {
package/index.js CHANGED
@@ -1,7 +1,16 @@
1
- "use strict";
2
-
3
- const sweph = require("./build/Release/sweph.node");
4
- sweph.constants = require("./constants.js");
5
- sweph.sweph = sweph;
6
- sweph.default = sweph;
7
- module.exports = sweph;
1
+ /// <reference path="index.d.ts"/>
2
+ "use strict";
3
+
4
+ /** @type {Omit<import("sweph"), "constants" | "sweph" | "default">} */
5
+ // @ts-ignore
6
+ const s = require("node-gyp-build")(__dirname);
7
+ const c = require("./constants.js");
8
+
9
+ const sweph = {
10
+ ...s,
11
+ constants: c,
12
+ sweph: s,
13
+ default: s
14
+ }
15
+
16
+ module.exports = sweph;
package/index.mjs CHANGED
@@ -1,101 +1,108 @@
1
1
  import { createRequire } from "module";
2
+ import { fileURLToPath } from "url";
2
3
  import c from "./constants.js";
3
4
 
5
+ const __dirname = fileURLToPath(new URL(".", import.meta.url));
4
6
  const require = createRequire(import.meta.url);
5
- export const sweph = require("./build/Release/sweph.node");
6
7
 
7
- sweph.constants = c;
8
- sweph.sweph = sweph;
9
- sweph.default = sweph;
8
+ /** @type {Omit<import("sweph"), "constants" | "sweph" | "default">} */
9
+ const s = require("node-gyp-build")(__dirname);
10
+
11
+ export const sweph = {
12
+ ...s,
13
+ constants: c,
14
+ sweph: s,
15
+ default: s
16
+ }
10
17
 
11
18
  export default sweph;
12
- export const constants = sweph.constants;
13
- export const close = sweph.close;
14
- export const set_delta_t_userdef = sweph.set_delta_t_userdef;
15
- export const set_ephe_path = sweph.set_ephe_path;
16
- export const set_jpl_file = sweph.set_jpl_file;
17
- export const set_sid_mode = sweph.set_sid_mode;
18
- export const set_tid_acc = sweph.set_tid_acc;
19
- export const set_topo = sweph.set_topo;
20
- export const version = sweph.version;
21
- export const get_library_path = sweph.get_library_path;
22
- export const get_tid_acc = sweph.get_tid_acc;
23
- export const get_planet_name = sweph.get_planet_name;
24
- export const get_current_file_data = sweph.get_current_file_data;
25
- export const get_orbital_elements = sweph.get_orbital_elements;
26
- export const get_ayanamsa_name = sweph.get_ayanamsa_name;
27
- export const get_ayanamsa_ex_ut = sweph.get_ayanamsa_ex_ut;
28
- export const get_ayanamsa_ex = sweph.get_ayanamsa_ex;
29
- export const get_ayanamsa_ut = sweph.get_ayanamsa_ut;
30
- export const get_ayanamsa = sweph.get_ayanamsa;
31
- export const calc = sweph.calc;
32
- export const calc_ut = sweph.calc_ut;
33
- export const calc_pctr = sweph.calc_pctr;
34
- export const fixstar = sweph.fixstar;
35
- export const fixstar_ut = sweph.fixstar_ut;
36
- export const fixstar_mag = sweph.fixstar_mag;
37
- export const fixstar2 = sweph.fixstar2;
38
- export const fixstar2_ut = sweph.fixstar2_ut;
39
- export const fixstar2_mag = sweph.fixstar2_mag;
40
- export const nod_aps = sweph.nod_aps;
41
- export const nod_aps_ut = sweph.nod_aps_ut;
42
- export const orbit_max_min_true_distance = sweph.orbit_max_min_true_distance;
43
- export const sol_eclipse_when_loc = sweph.sol_eclipse_when_loc;
44
- export const sol_eclipse_when_glob = sweph.sol_eclipse_when_glob;
45
- export const sol_eclipse_how = sweph.sol_eclipse_how;
46
- export const sol_eclipse_where = sweph.sol_eclipse_where;
47
- export const lun_occult_when_loc = sweph.lun_occult_when_loc;
48
- export const lun_occult_when_glob = sweph.lun_occult_when_glob;
49
- export const lun_occult_where = sweph.lun_occult_where;
50
- export const lun_eclipse_when_loc = sweph.lun_eclipse_when_loc;
51
- export const lun_eclipse_when = sweph.lun_eclipse_when;
52
- export const lun_eclipse_how = sweph.lun_eclipse_how;
53
- export const rise_trans = sweph.rise_trans;
54
- export const rise_trans_true_hor = sweph.rise_trans_true_hor;
55
- export const pheno = sweph.pheno;
56
- export const pheno_ut = sweph.pheno_ut;
57
- export const azalt = sweph.azalt;
58
- export const azalt_rev = sweph.azalt_rev;
59
- export const refrac = sweph.refrac;
60
- export const refrac_extended = sweph.refrac_extended;
61
- export const heliacal_ut = sweph.heliacal_ut;
62
- export const vis_limit_mag = sweph.vis_limit_mag;
63
- export const heliacal_pheno_ut = sweph.heliacal_pheno_ut;
64
- export const julday = sweph.julday;
65
- export const date_conversion = sweph.date_conversion;
66
- export const revjul = sweph.revjul;
67
- export const utc_time_zone = sweph.utc_time_zone;
68
- export const utc_to_jd = sweph.utc_to_jd;
69
- export const jdet_to_utc = sweph.jdet_to_utc;
70
- export const jdut1_to_utc = sweph.jdut1_to_utc;
71
- export const time_equ = sweph.time_equ;
72
- export const lmt_to_lat = sweph.lmt_to_lat;
73
- export const lat_to_lmt = sweph.lat_to_lmt;
74
- export const deltat = sweph.deltat;
75
- export const deltat_ex = sweph.deltat_ex;
76
- export const house_name = sweph.house_name;
77
- export const houses = sweph.houses;
78
- export const houses_armc = sweph.houses_armc;
79
- export const houses_armc_ex2 = sweph.houses_armc_ex2;
80
- export const houses_ex = sweph.houses_ex;
81
- export const houses_ex2 = sweph.houses_ex2;
82
- export const house_pos = sweph.house_pos;
83
- export const gauquelin_sector = sweph.gauquelin_sector;
84
- export const sidtime = sweph.sidtime;
85
- export const sidtime0 = sweph.sidtime0;
86
- export const cotrans = sweph.cotrans;
87
- export const cotrans_sp = sweph.cotrans_sp;
88
- export const degnorm = sweph.degnorm;
89
- export const radnorm = sweph.radnorm;
90
- export const split_deg = sweph.split_deg;
91
- export const csnorm = sweph.csnorm;
92
- export const difcsn = sweph.difcsn;
93
- export const difdegn = sweph.difdegn;
94
- export const difcs2n = sweph.difcs2n;
95
- export const difdeg2n = sweph.difdeg2n;
96
- export const csroundsec = sweph.csroundsec;
97
- export const d2l = sweph.d2l;
98
- export const day_of_week = sweph.day_of_week;
99
- export const cs2timestr = sweph.cs2timestr;
100
- export const cs2lonlatstr = sweph.cs2lonlatstr;
101
- export const cs2degstr = sweph.cs2degstr;
19
+ export const constants = c;
20
+ export const close = s.close;
21
+ export const set_delta_t_userdef = s.set_delta_t_userdef;
22
+ export const set_ephe_path = s.set_ephe_path;
23
+ export const set_jpl_file = s.set_jpl_file;
24
+ export const set_sid_mode = s.set_sid_mode;
25
+ export const set_tid_acc = s.set_tid_acc;
26
+ export const set_topo = s.set_topo;
27
+ export const version = s.version;
28
+ export const get_library_path = s.get_library_path;
29
+ export const get_tid_acc = s.get_tid_acc;
30
+ export const get_planet_name = s.get_planet_name;
31
+ export const get_current_file_data = s.get_current_file_data;
32
+ export const get_orbital_elements = s.get_orbital_elements;
33
+ export const get_ayanamsa_name = s.get_ayanamsa_name;
34
+ export const get_ayanamsa_ex_ut = s.get_ayanamsa_ex_ut;
35
+ export const get_ayanamsa_ex = s.get_ayanamsa_ex;
36
+ export const get_ayanamsa_ut = s.get_ayanamsa_ut;
37
+ export const get_ayanamsa = s.get_ayanamsa;
38
+ export const calc = s.calc;
39
+ export const calc_ut = s.calc_ut;
40
+ export const calc_pctr = s.calc_pctr;
41
+ export const fixstar = s.fixstar;
42
+ export const fixstar_ut = s.fixstar_ut;
43
+ export const fixstar_mag = s.fixstar_mag;
44
+ export const fixstar2 = s.fixstar2;
45
+ export const fixstar2_ut = s.fixstar2_ut;
46
+ export const fixstar2_mag = s.fixstar2_mag;
47
+ export const nod_aps = s.nod_aps;
48
+ export const nod_aps_ut = s.nod_aps_ut;
49
+ export const orbit_max_min_true_distance = s.orbit_max_min_true_distance;
50
+ export const sol_eclipse_when_loc = s.sol_eclipse_when_loc;
51
+ export const sol_eclipse_when_glob = s.sol_eclipse_when_glob;
52
+ export const sol_eclipse_how = s.sol_eclipse_how;
53
+ export const sol_eclipse_where = s.sol_eclipse_where;
54
+ export const lun_occult_when_loc = s.lun_occult_when_loc;
55
+ export const lun_occult_when_glob = s.lun_occult_when_glob;
56
+ export const lun_occult_where = s.lun_occult_where;
57
+ export const lun_eclipse_when_loc = s.lun_eclipse_when_loc;
58
+ export const lun_eclipse_when = s.lun_eclipse_when;
59
+ export const lun_eclipse_how = s.lun_eclipse_how;
60
+ export const rise_trans = s.rise_trans;
61
+ export const rise_trans_true_hor = s.rise_trans_true_hor;
62
+ export const pheno = s.pheno;
63
+ export const pheno_ut = s.pheno_ut;
64
+ export const azalt = s.azalt;
65
+ export const azalt_rev = s.azalt_rev;
66
+ export const refrac = s.refrac;
67
+ export const refrac_extended = s.refrac_extended;
68
+ export const heliacal_ut = s.heliacal_ut;
69
+ export const vis_limit_mag = s.vis_limit_mag;
70
+ export const heliacal_pheno_ut = s.heliacal_pheno_ut;
71
+ export const julday = s.julday;
72
+ export const date_conversion = s.date_conversion;
73
+ export const revjul = s.revjul;
74
+ export const utc_time_zone = s.utc_time_zone;
75
+ export const utc_to_jd = s.utc_to_jd;
76
+ export const jdet_to_utc = s.jdet_to_utc;
77
+ export const jdut1_to_utc = s.jdut1_to_utc;
78
+ export const time_equ = s.time_equ;
79
+ export const lmt_to_lat = s.lmt_to_lat;
80
+ export const lat_to_lmt = s.lat_to_lmt;
81
+ export const deltat = s.deltat;
82
+ export const deltat_ex = s.deltat_ex;
83
+ export const house_name = s.house_name;
84
+ export const houses = s.houses;
85
+ export const houses_armc = s.houses_armc;
86
+ export const houses_armc_ex2 = s.houses_armc_ex2;
87
+ export const houses_ex = s.houses_ex;
88
+ export const houses_ex2 = s.houses_ex2;
89
+ export const house_pos = s.house_pos;
90
+ export const gauquelin_sector = s.gauquelin_sector;
91
+ export const sidtime = s.sidtime;
92
+ export const sidtime0 = s.sidtime0;
93
+ export const cotrans = s.cotrans;
94
+ export const cotrans_sp = s.cotrans_sp;
95
+ export const degnorm = s.degnorm;
96
+ export const radnorm = s.radnorm;
97
+ export const split_deg = s.split_deg;
98
+ export const csnorm = s.csnorm;
99
+ export const difcsn = s.difcsn;
100
+ export const difdegn = s.difdegn;
101
+ export const difcs2n = s.difcs2n;
102
+ export const difdeg2n = s.difdeg2n;
103
+ export const csroundsec = s.csroundsec;
104
+ export const d2l = s.d2l;
105
+ export const day_of_week = s.day_of_week;
106
+ export const cs2timestr = s.cs2timestr;
107
+ export const cs2lonlatstr = s.cs2lonlatstr;
108
+ export const cs2degstr = s.cs2degstr;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sweph",
3
- "version": "2.10.0-10",
3
+ "version": "2.10.0-11",
4
4
  "description": "The definitive Swiss Ephemeris bindings for Node.js",
5
5
  "keywords": [
6
6
  "sweph",
@@ -18,11 +18,12 @@
18
18
  "url": "git+https://github.com/timotejroiko/sweph.git"
19
19
  },
20
20
  "funding": "https://github.com/timotejroiko/sweph?sponsor=1",
21
+ "license": "(GPL-2.0-or-later OR LGPL-3.0-or-later)",
21
22
  "author": "Timotej Valentin Rojko",
22
23
  "exports": {
24
+ "types": "./index.d.ts",
23
25
  "require": "./index.js",
24
- "import": "./index.mjs",
25
- "types": "./index.d.ts"
26
+ "import": "./index.mjs"
26
27
  },
27
28
  "main": "index.js",
28
29
  "types": "./index.d.ts",
@@ -31,6 +32,7 @@
31
32
  "./index.mjs",
32
33
  "./index.d.ts",
33
34
  "./constants.js",
35
+ "./prebuilds",
34
36
  "./binding.gyp",
35
37
  "./swisseph",
36
38
  "./src/functions",
@@ -39,14 +41,16 @@
39
41
  ],
40
42
  "scripts": {
41
43
  "preinstall": "node -e \"const { readdirSync, readFileSync, writeFileSync } = require('fs'); const file = readdirSync('./src/functions').map((x,i) => readFileSync('./src/functions/' + x, 'utf8').replace(/args/g, 'args' + i).replace('#include <sweph.h>', '')).reduce((a,b) => a + b, '#include <sweph.h>'); writeFileSync('./src/functions.cpp', file, 'utf8');\"",
42
- "install": "node-gyp rebuild && npm run test",
43
- "test": "node -e \"const s = require('./'); const c = s.calc(2222222,0,4); console.log('OK')\""
44
+ "rebuild": "node-gyp rebuild && npm run test",
45
+ "test": "node -e \"const s = require('./'); const c = s.calc(2222222,0,4); console.log('OK')\"",
46
+ "install": "node-gyp-build && npm run test",
47
+ "prebuild": "prebuildify --napi --strip"
44
48
  },
45
49
  "dependencies": {
46
- "node-addon-api": "*"
50
+ "node-addon-api": "^8.7.0",
51
+ "node-gyp-build": "^4.8.4"
47
52
  },
48
- "license": "(GPL-2.0-or-later OR LGPL-3.0-or-later)",
49
53
  "devDependencies": {
50
- "eslint": "^8.44.0"
54
+ "prebuildify": "^6.0.1"
51
55
  }
52
56
  }
Binary file
Binary file
Binary file