sweph 2.10.0-7 → 2.10.0-9
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/README.md +20 -14
- package/binding.gyp +22 -21
- package/index.d.ts +9 -9
- package/index.mjs +92 -92
- package/package.json +32 -14
- package/src/functions/calc.cpp +1 -1
- package/src/functions/calc_pctr.cpp +1 -1
- package/src/functions/calc_ut.cpp +1 -1
- package/src/functions/deltat_ex.cpp +1 -1
- package/src/functions/fixstar.cpp +1 -1
- package/src/functions/fixstar2.cpp +1 -1
- package/src/functions/fixstar2_mag.cpp +1 -1
- package/src/functions/fixstar2_ut.cpp +1 -1
- package/src/functions/fixstar_mag.cpp +1 -1
- package/src/functions/fixstar_ut.cpp +1 -1
- package/src/functions/gauquelin_sector.cpp +1 -1
- package/src/functions/get_ayanamsa_ex.cpp +1 -1
- package/src/functions/get_ayanamsa_ex_ut.cpp +1 -1
- package/src/functions/get_orbital_elements.cpp +1 -1
- package/src/functions/heliacal_pheno_ut.cpp +1 -1
- package/src/functions/heliacal_ut.cpp +1 -1
- package/src/functions/house_pos.cpp +1 -1
- package/src/functions/houses.cpp +1 -1
- package/src/functions/houses_armc_ex2.cpp +1 -1
- package/src/functions/houses_ex.cpp +1 -1
- package/src/functions/houses_ex2.cpp +2 -2
- package/src/functions/lat_to_lmt.cpp +1 -1
- package/src/functions/lmt_to_lat.cpp +1 -1
- package/src/functions/lun_eclipse_how.cpp +1 -1
- package/src/functions/lun_eclipse_when.cpp +1 -1
- package/src/functions/lun_eclipse_when_loc.cpp +1 -1
- package/src/functions/lun_occult_when_glob.cpp +1 -1
- package/src/functions/lun_occult_when_loc.cpp +1 -1
- package/src/functions/lun_occult_where.cpp +1 -1
- package/src/functions/nod_aps.cpp +1 -1
- package/src/functions/nod_aps_ut.cpp +1 -1
- package/src/functions/orbit_max_min_true_distance.cpp +1 -1
- package/src/functions/pheno.cpp +1 -1
- package/src/functions/pheno_ut.cpp +1 -1
- package/src/functions/rise_trans.cpp +1 -1
- package/src/functions/rise_trans_true_hor.cpp +1 -1
- package/src/functions/sol_eclipse_how.cpp +1 -1
- package/src/functions/sol_eclipse_when_glob.cpp +1 -1
- package/src/functions/sol_eclipse_when_loc.cpp +1 -1
- package/src/functions/sol_eclipse_where.cpp +1 -1
- package/src/functions/time_equ.cpp +1 -1
- package/src/functions/utc_to_jd.cpp +1 -1
- package/src/functions/vis_limit_mag.cpp +1 -1
- package/src/sweph.cpp +1 -1
- package/.github/FUNDING.yml +0 -5
- package/deps/swisseph.gyp +0 -43
- package/docs.gif +0 -0
- /package/{deps/swisseph → swisseph}/swecl.c +0 -0
- /package/{deps/swisseph → swisseph}/swedate.c +0 -0
- /package/{deps/swisseph → swisseph}/swedate.h +0 -0
- /package/{deps/swisseph → swisseph}/swehel.c +0 -0
- /package/{deps/swisseph → swisseph}/swehouse.c +0 -0
- /package/{deps/swisseph → swisseph}/swehouse.h +0 -0
- /package/{deps/swisseph → swisseph}/swejpl.c +0 -0
- /package/{deps/swisseph → swisseph}/swejpl.h +0 -0
- /package/{deps/swisseph → swisseph}/swemmoon.c +0 -0
- /package/{deps/swisseph → swisseph}/swemplan.c +0 -0
- /package/{deps/swisseph → swisseph}/swemptab.h +0 -0
- /package/{deps/swisseph → swisseph}/swenut2000a.h +0 -0
- /package/{deps/swisseph → swisseph}/sweodef.h +0 -0
- /package/{deps/swisseph → swisseph}/sweph.c +0 -0
- /package/{deps/swisseph → swisseph}/sweph.h +0 -0
- /package/{deps/swisseph → swisseph}/swephexp.h +0 -0
- /package/{deps/swisseph → swisseph}/swephlib.c +0 -0
- /package/{deps/swisseph → swisseph}/swephlib.h +0 -0
package/README.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# Sweph
|
|
2
2
|
|
|
3
3
|
The definitive Swiss Ephemeris bindings for Node.js
|
|
4
|
-
Everything you need to create Astrology and Astronomy applications with
|
|
4
|
+
Everything you need to create Astrology and Astronomy applications with JavaScript and node
|
|
5
5
|
|
|
6
6
|
* 100% API coverage
|
|
7
|
-
* Built-in Typescript declarations and ESM
|
|
7
|
+
* Built-in Typescript declarations and ESM exports
|
|
8
8
|
* Built-in intellisense documentation
|
|
9
9
|
* Version matched
|
|
10
10
|
* Made with the N-API
|
|
11
11
|
|
|
12
|
-
[Official
|
|
12
|
+
[Official programmer's documentation for the Swiss Ephemeris by Astrodienst AG](https://www.astro.com/swisseph/swephprg.htm)
|
|
13
13
|
[Official guide for the Swiss Ephemeris by Astrodienst AG](https://www.astro.com/ftp/swisseph/doc/swisseph.htm)
|
|
14
|
-
[Sweph on
|
|
14
|
+
[Sweph on GitHub](https://github.com/timotejroiko/sweph)
|
|
15
15
|
[Sweph on NPM](https://npmjs.com/package/sweph)
|
|
16
16
|
|
|
17
17
|
## Installation and Licensing
|
|
@@ -26,7 +26,7 @@ To install and use this library under GPL, use `npm install sweph@gpl` or `npm i
|
|
|
26
26
|
### - AGPL
|
|
27
27
|
|
|
28
28
|
Starting from version `2.10.1` and later, this library is licensed under `AGPL-3.0`.
|
|
29
|
-
To install and use the latest version of this library under AGPL, use `npm install sweph`.
|
|
29
|
+
To install and use the latest version of this library under AGPL, use `npm install sweph` or `npm install sweph@latest`.
|
|
30
30
|
|
|
31
31
|
### - LGPL
|
|
32
32
|
|
|
@@ -36,7 +36,7 @@ If you own a professional license for the Swiss Ephemeris, you may use any versi
|
|
|
36
36
|
|
|
37
37
|
This library is version locked to the Swiss Ephemeris in addition to its own revisions. For example, version `2.10.1-1` corresponds to the Swiss Ephemeris version `2.10.1` and this library's revision `1`.
|
|
38
38
|
|
|
39
|
-
Updates to this library will be released under new revisions, while updates to Swiss Ephemeris will be released under matching
|
|
39
|
+
Updates to this library will be released under new revisions, while updates to Swiss Ephemeris will be released under matching SemVer versions.
|
|
40
40
|
|
|
41
41
|
## Documentation
|
|
42
42
|
|
|
@@ -56,22 +56,28 @@ Each main ephemeris file covers a range of 600 years starting from the century i
|
|
|
56
56
|
* semom files - moon (BC)
|
|
57
57
|
* seas files - main asteroids (AD)
|
|
58
58
|
* seasm files - main asteroids (BC)
|
|
59
|
+
|
|
59
60
|
For advanced usage, the following files can also be found:
|
|
61
|
+
|
|
60
62
|
* astxxx folders - files for individual asteroids (600 years)
|
|
61
63
|
* longfiles folder - files for individual asteroids (6000 years)
|
|
62
|
-
* jplfiles folder - files for
|
|
64
|
+
* jplfiles folder - files for NASA's JPL ephemerides
|
|
63
65
|
* sat folder - files for planetary moons
|
|
64
|
-
|
|
66
|
+
|
|
67
|
+
More information can be found in the [Swiss Ephemeris files documentation](https://www.astro.com/ftp/swisseph/doc/swisseph.htm).
|
|
65
68
|
|
|
66
69
|
## Contributing
|
|
67
70
|
|
|
68
|
-
If you find any
|
|
71
|
+
If you find any inaccuracy or bug in this library, or if you find an upstream update that is not yet included in this library, feel free to open an issue or a pull request.
|
|
72
|
+
|
|
73
|
+
## Limitations
|
|
74
|
+
|
|
75
|
+
* While worker_threads are supported, the underlying C library is single threaded and contains process-wide settings. Functions such as `set_ephe_path()` or `set_sid_mode()` will affect the entire process, including all worker_threads. While you can still use worker_threads as long as you don't change settings from other threads in the middle of calculations, true thread-safe multithreading can only be achieved using child_process.
|
|
69
76
|
|
|
70
|
-
|
|
77
|
+
* This library is a C/C++ add-on designed for Node.JS only, it will not work in browsers, other JS engines or in any other environment that does not support native C/C++ add-ons. In order to install this library, the target system must have the necessary build tools installed, such as `python`, `make` and `gcc` on Linux, `xcode` on Mac, `visual c++` on Windows, and/or other equivalent solutions.
|
|
71
78
|
|
|
72
|
-
|
|
73
|
-
* While worker_threads are supported, the underlying C library is single threaded and its settings are global. Functions such as `set_ephe_path()` will affect the entire process, including worker_threads. While you can still use worker_threads as long as you dont change settings from other threads in the middle of calculations, true thead-safe multithreading can be achieved using child_process instead.
|
|
79
|
+
## Copyright
|
|
74
80
|
|
|
75
|
-
|
|
81
|
+
Copyright © 2021-2023, Timotej Valentin Rojko
|
|
76
82
|
|
|
77
|
-
|
|
83
|
+
This library is offered free of charge for any type of use, including commercial use, however, if you're an individual or a company using this library in commercial products and/or services, consider subscribing to the appropriate sponsorship level [here](https://github.com/sponsors/timotejroiko) and get priority support for your business.
|
package/binding.gyp
CHANGED
|
@@ -4,36 +4,37 @@
|
|
|
4
4
|
"target_name": "sweph",
|
|
5
5
|
"sources": [
|
|
6
6
|
"src/sweph.cpp",
|
|
7
|
-
"
|
|
7
|
+
"src/functions.cpp"
|
|
8
8
|
],
|
|
9
9
|
"include_dirs": [
|
|
10
10
|
"<!(node -p \"require('node-addon-api').include_dir\")",
|
|
11
11
|
"src"
|
|
12
12
|
],
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
"dependencies": [
|
|
14
|
+
"swisseph"
|
|
15
15
|
],
|
|
16
16
|
"defines": [
|
|
17
17
|
"NAPI_DISABLE_CPP_EXCEPTIONS"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"target_name": "swisseph",
|
|
22
|
+
'type': "static_library",
|
|
23
|
+
"sources": [
|
|
24
|
+
"swisseph/swecl.c",
|
|
25
|
+
"swisseph/swedate.c",
|
|
26
|
+
"swisseph/swehel.c",
|
|
27
|
+
"swisseph/swehouse.c",
|
|
28
|
+
"swisseph/swejpl.c",
|
|
29
|
+
"swisseph/swemmoon.c",
|
|
30
|
+
"swisseph/swemplan.c",
|
|
31
|
+
"swisseph/sweph.c",
|
|
32
|
+
"swisseph/swephlib.c"
|
|
18
33
|
],
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
],
|
|
24
|
-
"cflags_cc": [
|
|
25
|
-
"-flto",
|
|
26
|
-
"-Ofast",
|
|
27
|
-
"-pipe"
|
|
28
|
-
],
|
|
29
|
-
"msvs_settings": {
|
|
30
|
-
"VCCLCompilerTool": {
|
|
31
|
-
"AdditionalOptions": [
|
|
32
|
-
"/O2",
|
|
33
|
-
"/GL",
|
|
34
|
-
"/Gw"
|
|
35
|
-
]
|
|
36
|
-
}
|
|
34
|
+
"direct_dependent_settings": {
|
|
35
|
+
"include_dirs": [
|
|
36
|
+
"swisseph"
|
|
37
|
+
]
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
]
|
package/index.d.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* ## Sweph
|
|
3
3
|
* Definitive Swiss Ephemeris bindings for Node.js
|
|
4
4
|
*
|
|
5
|
-
* [Official
|
|
5
|
+
* [Official programmer's documentation for the Swiss Ephemeris](https://www.astro.com/swisseph/swephprg.htm)
|
|
6
6
|
* [Official guide for the Swiss Ephemeris](https://www.astro.com/ftp/swisseph/doc/swisseph.htm)
|
|
7
|
-
* [Sweph on
|
|
7
|
+
* [Sweph on GitHub](https://github.com/timotejroiko/sweph)
|
|
8
8
|
* [Sweph on NPM](http://npmjs.com/package/sweph)
|
|
9
9
|
*
|
|
10
10
|
* ### Usage
|
|
@@ -649,7 +649,7 @@ declare module "sweph" {
|
|
|
649
649
|
* ```
|
|
650
650
|
* ```
|
|
651
651
|
*/
|
|
652
|
-
data:
|
|
652
|
+
data: JdEtUt;
|
|
653
653
|
}
|
|
654
654
|
|
|
655
655
|
interface VisLimitMag extends Flag, Error {
|
|
@@ -1728,7 +1728,7 @@ declare module "sweph" {
|
|
|
1728
1728
|
dip: number
|
|
1729
1729
|
]
|
|
1730
1730
|
|
|
1731
|
-
type
|
|
1731
|
+
type JdEtUt = [
|
|
1732
1732
|
/**
|
|
1733
1733
|
* Julian day in ephemeris/terrestrial time
|
|
1734
1734
|
*/
|
|
@@ -2064,7 +2064,7 @@ declare module "sweph" {
|
|
|
2064
2064
|
* ```
|
|
2065
2065
|
* • csec: number // Centiseconds value
|
|
2066
2066
|
* • sep: string // Separator character
|
|
2067
|
-
* •
|
|
2067
|
+
* • suppresszero: boolean // Omit seconds if they are zero
|
|
2068
2068
|
* ```
|
|
2069
2069
|
* ### Returns
|
|
2070
2070
|
* ```
|
|
@@ -2076,7 +2076,7 @@ declare module "sweph" {
|
|
|
2076
2076
|
* ```
|
|
2077
2077
|
*
|
|
2078
2078
|
*/
|
|
2079
|
-
export function cs2timestr(csec: number, sep: string,
|
|
2079
|
+
export function cs2timestr(csec: number, sep: string, suppresszero: boolean): string;
|
|
2080
2080
|
|
|
2081
2081
|
/**
|
|
2082
2082
|
* ### Description
|
|
@@ -2161,7 +2161,7 @@ declare module "sweph" {
|
|
|
2161
2161
|
* ```
|
|
2162
2162
|
*
|
|
2163
2163
|
*/
|
|
2164
|
-
export function date_conversion(year: number, month: number, day: number, hour: number, calendar: string): DateConversion;
|
|
2164
|
+
export function date_conversion(year: number, month: number, day: number, hour: number, calendar: "g" | "j" | (string & {})): DateConversion;
|
|
2165
2165
|
|
|
2166
2166
|
/**
|
|
2167
2167
|
* ### Description
|
|
@@ -2572,7 +2572,7 @@ declare module "sweph" {
|
|
|
2572
2572
|
* ```
|
|
2573
2573
|
*
|
|
2574
2574
|
*/
|
|
2575
|
-
export function gauquelin_sector(tjd_ut: number, ipl: number, starname: string | null, iflag: number, imeth: number, geopos: [number,number,number], atpress: number, attemp: number): GauquelinSector;
|
|
2575
|
+
export function gauquelin_sector(tjd_ut: number, ipl: number, starname: string | null, iflag: number, imeth: number, geopos: [longitude: number, latitude: number, elevation: number], atpress: number, attemp: number): GauquelinSector;
|
|
2576
2576
|
|
|
2577
2577
|
/**
|
|
2578
2578
|
* ### Description
|
|
@@ -3918,7 +3918,7 @@ declare module "sweph" {
|
|
|
3918
3918
|
* ### Params
|
|
3919
3919
|
* ```
|
|
3920
3920
|
* • tjd: number // Julian day in universal time
|
|
3921
|
-
* • gregflag: number // Calendar
|
|
3921
|
+
* • gregflag: number // Calendar system, SE_GREG_CAL for gregorian calendar, SE_JUL_CAL for julian calendar
|
|
3922
3922
|
* ```
|
|
3923
3923
|
* ### Returns
|
|
3924
3924
|
* ```
|
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createRequire } from
|
|
1
|
+
import { createRequire } from "module";
|
|
2
2
|
import c from "./constants.js";
|
|
3
3
|
|
|
4
4
|
const require = createRequire(import.meta.url);
|
|
@@ -8,94 +8,94 @@ sweph.constants = c;
|
|
|
8
8
|
sweph.sweph = sweph;
|
|
9
9
|
sweph.default = sweph;
|
|
10
10
|
|
|
11
|
-
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
|
|
11
|
+
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;
|
package/package.json
CHANGED
|
@@ -1,30 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sweph",
|
|
3
|
-
"version": "2.10.0-
|
|
3
|
+
"version": "2.10.0-9",
|
|
4
4
|
"description": "The definitive Swiss Ephemeris bindings for Node.js",
|
|
5
|
-
"
|
|
6
|
-
|
|
5
|
+
"keywords": [
|
|
6
|
+
"sweph",
|
|
7
|
+
"swiss",
|
|
8
|
+
"ephemeris",
|
|
9
|
+
"astrology",
|
|
10
|
+
"astronomy",
|
|
11
|
+
"swisseph",
|
|
12
|
+
"node"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/timotejroiko/sweph",
|
|
15
|
+
"bugs": "https://github.com/timotejroiko/sweph/issues",
|
|
16
|
+
"repository": "github:timotejroiko/sweph",
|
|
17
|
+
"funding": "https://github.com/timotejroiko/sweph?sponsor=1",
|
|
18
|
+
"author": "Timotej Valentin Rojko",
|
|
7
19
|
"exports": {
|
|
8
20
|
"require": "./index.js",
|
|
9
21
|
"import": "./index.mjs"
|
|
10
22
|
},
|
|
23
|
+
"main": "index.js",
|
|
24
|
+
"types": "./index.d.ts",
|
|
25
|
+
"files": [
|
|
26
|
+
"./index.js",
|
|
27
|
+
"./index.mjs",
|
|
28
|
+
"./index.d.ts",
|
|
29
|
+
"./constants.js",
|
|
30
|
+
"./binding.gyp",
|
|
31
|
+
"./swisseph",
|
|
32
|
+
"./src/functions",
|
|
33
|
+
"./src/sweph.cpp",
|
|
34
|
+
"./src/sweph.h"
|
|
35
|
+
],
|
|
11
36
|
"scripts": {
|
|
12
|
-
"
|
|
37
|
+
"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');\"",
|
|
38
|
+
"install": "node-gyp rebuild && npm run test",
|
|
39
|
+
"test": "node -e \"const s = require('./'); const c = s.calc(2222222,0,4); console.log('OK')\""
|
|
13
40
|
},
|
|
14
|
-
"repository": {
|
|
15
|
-
"url": "https://github.com/timotejroiko/sweph.git"
|
|
16
|
-
},
|
|
17
|
-
"bugs": "https://github.com/timotejroiko/sweph/issues",
|
|
18
41
|
"dependencies": {
|
|
19
42
|
"node-addon-api": "*"
|
|
20
43
|
},
|
|
21
|
-
"funding": {
|
|
22
|
-
"type": "patreon",
|
|
23
|
-
"url": "https://patreon.com/timotejroiko"
|
|
24
|
-
},
|
|
25
|
-
"author": "Timotej Valentin Rojko",
|
|
26
44
|
"license": "(GPL-2.0-or-later OR LGPL-3.0-or-later)",
|
|
27
45
|
"devDependencies": {
|
|
28
|
-
"eslint": "^8.
|
|
46
|
+
"eslint": "^8.44.0"
|
|
29
47
|
}
|
|
30
48
|
}
|
package/src/functions/calc.cpp
CHANGED
|
@@ -13,7 +13,7 @@ Napi::Value sweph_calc(const Napi::CallbackInfo& info) {
|
|
|
13
13
|
return env.Null();
|
|
14
14
|
}
|
|
15
15
|
double xx [6];
|
|
16
|
-
char serr [AS_MAXCH];
|
|
16
|
+
char serr [AS_MAXCH] = "";
|
|
17
17
|
int32 flag = swe_calc(
|
|
18
18
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
19
19
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -14,7 +14,7 @@ Napi::Value sweph_calc_pctr(const Napi::CallbackInfo& info) {
|
|
|
14
14
|
return env.Null();
|
|
15
15
|
}
|
|
16
16
|
double xx [6];
|
|
17
|
-
char serr [AS_MAXCH];
|
|
17
|
+
char serr [AS_MAXCH] = "";
|
|
18
18
|
int32 flag = swe_calc_pctr(
|
|
19
19
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
20
20
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -13,7 +13,7 @@ Napi::Value sweph_calc_ut(const Napi::CallbackInfo& info) {
|
|
|
13
13
|
return env.Null();
|
|
14
14
|
}
|
|
15
15
|
double xx [6];
|
|
16
|
-
char serr [AS_MAXCH];
|
|
16
|
+
char serr [AS_MAXCH] = "";
|
|
17
17
|
int32 flag = swe_calc_ut(
|
|
18
18
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
19
19
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -11,7 +11,7 @@ Napi::Value sweph_deltat_ex(const Napi::CallbackInfo& info) {
|
|
|
11
11
|
if(!sweph_type_check(args, info)) {
|
|
12
12
|
return env.Null();
|
|
13
13
|
}
|
|
14
|
-
char serr [AS_MAXCH];
|
|
14
|
+
char serr [AS_MAXCH] = "";
|
|
15
15
|
double delta = swe_deltat_ex(
|
|
16
16
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
17
17
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -13,7 +13,7 @@ Napi::Value sweph_fixstar(const Napi::CallbackInfo& info) {
|
|
|
13
13
|
return env.Null();
|
|
14
14
|
}
|
|
15
15
|
double xx [6];
|
|
16
|
-
char serr [AS_MAXCH];
|
|
16
|
+
char serr [AS_MAXCH] = "";
|
|
17
17
|
char star [AS_MAXCH];
|
|
18
18
|
strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
|
|
19
19
|
int32 flag = swe_fixstar(
|
|
@@ -13,7 +13,7 @@ Napi::Value sweph_fixstar2(const Napi::CallbackInfo& info) {
|
|
|
13
13
|
return env.Null();
|
|
14
14
|
}
|
|
15
15
|
double xx [6];
|
|
16
|
-
char serr [AS_MAXCH];
|
|
16
|
+
char serr [AS_MAXCH] = "";
|
|
17
17
|
char star [AS_MAXCH];
|
|
18
18
|
strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
|
|
19
19
|
int32 flag = swe_fixstar2(
|
|
@@ -11,7 +11,7 @@ Napi::Value sweph_fixstar2_mag(const Napi::CallbackInfo& info) {
|
|
|
11
11
|
return env.Null();
|
|
12
12
|
}
|
|
13
13
|
double mag;
|
|
14
|
-
char serr [AS_MAXCH];
|
|
14
|
+
char serr [AS_MAXCH] = "";
|
|
15
15
|
char star [AS_MAXCH];
|
|
16
16
|
strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
|
|
17
17
|
int32 flag = swe_fixstar2_mag(
|
|
@@ -13,7 +13,7 @@ Napi::Value sweph_fixstar2_ut(const Napi::CallbackInfo& info) {
|
|
|
13
13
|
return env.Null();
|
|
14
14
|
}
|
|
15
15
|
double xx [6];
|
|
16
|
-
char serr [AS_MAXCH];
|
|
16
|
+
char serr [AS_MAXCH] = "";
|
|
17
17
|
char star [AS_MAXCH];
|
|
18
18
|
strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
|
|
19
19
|
int32 flag = swe_fixstar2_ut(
|
|
@@ -11,7 +11,7 @@ Napi::Value sweph_fixstar_mag(const Napi::CallbackInfo& info) {
|
|
|
11
11
|
return env.Null();
|
|
12
12
|
}
|
|
13
13
|
double mag;
|
|
14
|
-
char serr [AS_MAXCH];
|
|
14
|
+
char serr [AS_MAXCH] = "";
|
|
15
15
|
char star [AS_MAXCH];
|
|
16
16
|
strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
|
|
17
17
|
int32 flag = swe_fixstar_mag(
|
|
@@ -13,7 +13,7 @@ Napi::Value sweph_fixstar_ut(const Napi::CallbackInfo& info) {
|
|
|
13
13
|
return env.Null();
|
|
14
14
|
}
|
|
15
15
|
double xx [6];
|
|
16
|
-
char serr [AS_MAXCH];
|
|
16
|
+
char serr [AS_MAXCH] = "";
|
|
17
17
|
char star [AS_MAXCH];
|
|
18
18
|
strcpy(star, info[0].As<Napi::String>().Utf8Value().c_str());
|
|
19
19
|
int32 flag = swe_fixstar_ut(
|
|
@@ -23,7 +23,7 @@ Napi::Value sweph_gauquelin_sector(const Napi::CallbackInfo& info) {
|
|
|
23
23
|
return env.Null();
|
|
24
24
|
}
|
|
25
25
|
double sect;
|
|
26
|
-
char serr [AS_MAXCH];
|
|
26
|
+
char serr [AS_MAXCH] = "";
|
|
27
27
|
int32 flag = swe_gauquelin_sector(
|
|
28
28
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
29
29
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -12,7 +12,7 @@ Napi::Value sweph_get_ayanamsa_ex(const Napi::CallbackInfo& info) {
|
|
|
12
12
|
return env.Null();
|
|
13
13
|
}
|
|
14
14
|
double aya;
|
|
15
|
-
char serr [AS_MAXCH];
|
|
15
|
+
char serr [AS_MAXCH] = "";
|
|
16
16
|
int32 flag = swe_get_ayanamsa_ex(
|
|
17
17
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
18
18
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -12,7 +12,7 @@ Napi::Value sweph_get_ayanamsa_ex_ut(const Napi::CallbackInfo& info) {
|
|
|
12
12
|
return env.Null();
|
|
13
13
|
}
|
|
14
14
|
double aya;
|
|
15
|
-
char serr [AS_MAXCH];
|
|
15
|
+
char serr [AS_MAXCH] = "";
|
|
16
16
|
int32 flag = swe_get_ayanamsa_ex_ut(
|
|
17
17
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
18
18
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -13,7 +13,7 @@ Napi::Value sweph_get_orbital_elements(const Napi::CallbackInfo& info) {
|
|
|
13
13
|
return env.Null();
|
|
14
14
|
}
|
|
15
15
|
double ret [50];
|
|
16
|
-
char serr [AS_MAXCH];
|
|
16
|
+
char serr [AS_MAXCH] = "";
|
|
17
17
|
int32 flag = swe_get_orbital_elements(
|
|
18
18
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
19
19
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -31,7 +31,7 @@ Napi::Value sweph_heliacal_pheno_ut(const Napi::CallbackInfo& info) {
|
|
|
31
31
|
Napi::TypeError::New(env, args[4].second).ThrowAsJavaScriptException();
|
|
32
32
|
return env.Null();
|
|
33
33
|
}
|
|
34
|
-
char serr [AS_MAXCH];
|
|
34
|
+
char serr [AS_MAXCH] = "";
|
|
35
35
|
double ret [50];
|
|
36
36
|
int32 flag = swe_heliacal_pheno_ut(
|
|
37
37
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
@@ -31,7 +31,7 @@ Napi::Value sweph_heliacal_ut(const Napi::CallbackInfo& info) {
|
|
|
31
31
|
Napi::TypeError::New(env, args[4].second).ThrowAsJavaScriptException();
|
|
32
32
|
return env.Null();
|
|
33
33
|
}
|
|
34
|
-
char serr [AS_MAXCH];
|
|
34
|
+
char serr [AS_MAXCH] = "";
|
|
35
35
|
double ret [50];
|
|
36
36
|
int32 flag = swe_heliacal_ut(
|
|
37
37
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
@@ -19,7 +19,7 @@ Napi::Value sweph_house_pos(const Napi::CallbackInfo& info) {
|
|
|
19
19
|
Napi::TypeError::New(env, args[5].second).ThrowAsJavaScriptException();
|
|
20
20
|
return env.Null();
|
|
21
21
|
}
|
|
22
|
-
char serr [AS_MAXCH];
|
|
22
|
+
char serr [AS_MAXCH] = "";
|
|
23
23
|
char sys = info[3].As<Napi::String>().Utf8Value()[0];
|
|
24
24
|
double house = swe_house_pos(
|
|
25
25
|
info[0].As<Napi::Number>().DoubleValue(),
|
package/src/functions/houses.cpp
CHANGED
|
@@ -16,7 +16,6 @@ Napi::Value sweph_houses(const Napi::CallbackInfo& info) {
|
|
|
16
16
|
double cusps [37];
|
|
17
17
|
double points [10];
|
|
18
18
|
char sys = info[3].As<Napi::String>().Utf8Value()[0];
|
|
19
|
-
int g = sys == 'G' ? 37 : 13;
|
|
20
19
|
int flag = swe_houses(
|
|
21
20
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
22
21
|
info[1].As<Napi::Number>().DoubleValue(),
|
|
@@ -25,6 +24,7 @@ Napi::Value sweph_houses(const Napi::CallbackInfo& info) {
|
|
|
25
24
|
cusps,
|
|
26
25
|
points
|
|
27
26
|
);
|
|
27
|
+
int g = sys == 'G' && flag == OK ? 37 : 13;
|
|
28
28
|
Napi::Object data = Napi::Object::New(env);
|
|
29
29
|
data["houses"] = sweph_js_array_converter(&cusps[1], g-1, env);
|
|
30
30
|
data["points"] = sweph_js_array_converter(points, 8, env);
|
|
@@ -20,7 +20,7 @@ Napi::Value sweph_houses_armc_ex2(const Napi::CallbackInfo& info) {
|
|
|
20
20
|
}
|
|
21
21
|
double cspeed [37];
|
|
22
22
|
double pspeed [10];
|
|
23
|
-
char serr [AS_MAXCH];
|
|
23
|
+
char serr [AS_MAXCH] = "";
|
|
24
24
|
char sys = info[3].As<Napi::String>().Utf8Value()[0];
|
|
25
25
|
int g = sys == 'G' ? 37 : 13;
|
|
26
26
|
int flag = swe_houses_armc_ex2(
|
|
@@ -17,7 +17,6 @@ Napi::Value sweph_houses_ex(const Napi::CallbackInfo& info) {
|
|
|
17
17
|
double cusps [37];
|
|
18
18
|
double points [10];
|
|
19
19
|
char sys = info[4].As<Napi::String>().Utf8Value()[0];
|
|
20
|
-
int g = sys == 'G' ? 37 : 13;
|
|
21
20
|
int flag = swe_houses_ex(
|
|
22
21
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
23
22
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -27,6 +26,7 @@ Napi::Value sweph_houses_ex(const Napi::CallbackInfo& info) {
|
|
|
27
26
|
cusps,
|
|
28
27
|
points
|
|
29
28
|
);
|
|
29
|
+
int g = sys == 'G' && flag == OK ? 37 : 13;
|
|
30
30
|
Napi::Object data = Napi::Object::New(env);
|
|
31
31
|
data["houses"] = sweph_js_array_converter(&cusps[1], g-1, env);
|
|
32
32
|
data["points"] = sweph_js_array_converter(points, 8, env);
|
|
@@ -18,9 +18,8 @@ Napi::Value sweph_houses_ex2(const Napi::CallbackInfo& info) {
|
|
|
18
18
|
double points [10];
|
|
19
19
|
double cspeed [37];
|
|
20
20
|
double pspeed [10];
|
|
21
|
-
char serr [AS_MAXCH];
|
|
21
|
+
char serr [AS_MAXCH] = "";
|
|
22
22
|
char sys = info[4].As<Napi::String>().Utf8Value()[0];
|
|
23
|
-
int g = sys == 'G' ? 37 : 13;
|
|
24
23
|
int flag = swe_houses_ex2(
|
|
25
24
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
26
25
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -33,6 +32,7 @@ Napi::Value sweph_houses_ex2(const Napi::CallbackInfo& info) {
|
|
|
33
32
|
pspeed,
|
|
34
33
|
serr
|
|
35
34
|
);
|
|
35
|
+
int g = sys == 'G' && flag == OK ? 37 : 13;
|
|
36
36
|
Napi::Object data = Napi::Object::New(env);
|
|
37
37
|
data["houses"] = sweph_js_array_converter(&cusps[1], g-1, env);
|
|
38
38
|
data["points"] = sweph_js_array_converter(points, 8, env);
|
|
@@ -12,7 +12,7 @@ Napi::Value sweph_lat_to_lmt(const Napi::CallbackInfo& info) {
|
|
|
12
12
|
return env.Null();
|
|
13
13
|
}
|
|
14
14
|
double conv;
|
|
15
|
-
char serr [AS_MAXCH];
|
|
15
|
+
char serr [AS_MAXCH] = "";
|
|
16
16
|
int32 flag = swe_lat_to_lmt(
|
|
17
17
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
18
18
|
info[1].As<Napi::Number>().DoubleValue(),
|
|
@@ -12,7 +12,7 @@ Napi::Value sweph_lmt_to_lat(const Napi::CallbackInfo& info) {
|
|
|
12
12
|
return env.Null();
|
|
13
13
|
}
|
|
14
14
|
double conv;
|
|
15
|
-
char serr [AS_MAXCH];
|
|
15
|
+
char serr [AS_MAXCH] = "";
|
|
16
16
|
int32 flag = swe_lmt_to_lat(
|
|
17
17
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
18
18
|
info[1].As<Napi::Number>().DoubleValue(),
|
|
@@ -18,7 +18,7 @@ Napi::Value sweph_lun_eclipse_how(const Napi::CallbackInfo& info) {
|
|
|
18
18
|
return env.Null();
|
|
19
19
|
}
|
|
20
20
|
double attr [20];
|
|
21
|
-
char serr [AS_MAXCH];
|
|
21
|
+
char serr [AS_MAXCH] = "";
|
|
22
22
|
int32 flag = swe_lun_eclipse_how(
|
|
23
23
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
24
24
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -14,7 +14,7 @@ Napi::Value sweph_lun_eclipse_when(const Napi::CallbackInfo& info) {
|
|
|
14
14
|
return env.Null();
|
|
15
15
|
}
|
|
16
16
|
double ret [10];
|
|
17
|
-
char serr [AS_MAXCH];
|
|
17
|
+
char serr [AS_MAXCH] = "";
|
|
18
18
|
int32 flag = swe_lun_eclipse_when(
|
|
19
19
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
20
20
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -20,7 +20,7 @@ Napi::Value sweph_lun_eclipse_when_loc(const Napi::CallbackInfo& info) {
|
|
|
20
20
|
}
|
|
21
21
|
double ret [10];
|
|
22
22
|
double attr [20];
|
|
23
|
-
char serr [AS_MAXCH];
|
|
23
|
+
char serr [AS_MAXCH] = "";
|
|
24
24
|
int32 flag = swe_lun_eclipse_when_loc(
|
|
25
25
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
26
26
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -16,7 +16,7 @@ Napi::Value sweph_lun_occult_when_glob(const Napi::CallbackInfo& info) {
|
|
|
16
16
|
return env.Null();
|
|
17
17
|
}
|
|
18
18
|
double ret [10];
|
|
19
|
-
char serr [AS_MAXCH];
|
|
19
|
+
char serr [AS_MAXCH] = "";
|
|
20
20
|
int32 flag = swe_lun_occult_when_glob(
|
|
21
21
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
22
22
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -22,7 +22,7 @@ Napi::Value sweph_lun_occult_when_loc(const Napi::CallbackInfo& info) {
|
|
|
22
22
|
}
|
|
23
23
|
double ret [10];
|
|
24
24
|
double attr [20];
|
|
25
|
-
char serr [AS_MAXCH];
|
|
25
|
+
char serr [AS_MAXCH] = "";
|
|
26
26
|
int32 flag = swe_lun_occult_when_loc(
|
|
27
27
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
28
28
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -15,7 +15,7 @@ Napi::Value sweph_lun_occult_where(const Napi::CallbackInfo& info) {
|
|
|
15
15
|
}
|
|
16
16
|
double geopos [10];
|
|
17
17
|
double attr [20];
|
|
18
|
-
char serr [AS_MAXCH];
|
|
18
|
+
char serr [AS_MAXCH] = "";
|
|
19
19
|
int32 flag = swe_lun_occult_where(
|
|
20
20
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
21
21
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -17,7 +17,7 @@ Napi::Value sweph_nod_aps(const Napi::CallbackInfo& info) {
|
|
|
17
17
|
double dsc [6];
|
|
18
18
|
double per [6];
|
|
19
19
|
double aph [6];
|
|
20
|
-
char serr [AS_MAXCH];
|
|
20
|
+
char serr [AS_MAXCH] = "";
|
|
21
21
|
int32 flag = swe_nod_aps(
|
|
22
22
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
23
23
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -17,7 +17,7 @@ Napi::Value sweph_nod_aps_ut(const Napi::CallbackInfo& info) {
|
|
|
17
17
|
double dsc [6];
|
|
18
18
|
double per [6];
|
|
19
19
|
double aph [6];
|
|
20
|
-
char serr [AS_MAXCH];
|
|
20
|
+
char serr [AS_MAXCH] = "";
|
|
21
21
|
int32 flag = swe_nod_aps_ut(
|
|
22
22
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
23
23
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -15,7 +15,7 @@ Napi::Value sweph_orbit_max_min_true_distance(const Napi::CallbackInfo& info) {
|
|
|
15
15
|
double dmax;
|
|
16
16
|
double dmin;
|
|
17
17
|
double dtrue;
|
|
18
|
-
char serr [AS_MAXCH];
|
|
18
|
+
char serr [AS_MAXCH] = "";
|
|
19
19
|
int32 flag = swe_orbit_max_min_true_distance(
|
|
20
20
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
21
21
|
info[1].As<Napi::Number>().Int32Value(),
|
package/src/functions/pheno.cpp
CHANGED
|
@@ -13,7 +13,7 @@ Napi::Value sweph_pheno(const Napi::CallbackInfo& info) {
|
|
|
13
13
|
return env.Null();
|
|
14
14
|
}
|
|
15
15
|
double attr [20];
|
|
16
|
-
char serr [AS_MAXCH];
|
|
16
|
+
char serr [AS_MAXCH] = "";
|
|
17
17
|
int32 flag = swe_pheno(
|
|
18
18
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
19
19
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -13,7 +13,7 @@ Napi::Value sweph_pheno_ut(const Napi::CallbackInfo& info) {
|
|
|
13
13
|
return env.Null();
|
|
14
14
|
}
|
|
15
15
|
double attr [20];
|
|
16
|
-
char serr [AS_MAXCH];
|
|
16
|
+
char serr [AS_MAXCH] = "";
|
|
17
17
|
int32 flag = swe_pheno_ut(
|
|
18
18
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
19
19
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -23,7 +23,7 @@ Napi::Value sweph_rise_trans(const Napi::CallbackInfo& info) {
|
|
|
23
23
|
return env.Null();
|
|
24
24
|
}
|
|
25
25
|
double ret;
|
|
26
|
-
char serr [AS_MAXCH];
|
|
26
|
+
char serr [AS_MAXCH] = "";
|
|
27
27
|
int32 flag = swe_rise_trans(
|
|
28
28
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
29
29
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -24,7 +24,7 @@ Napi::Value sweph_rise_trans_true_hor(const Napi::CallbackInfo& info) {
|
|
|
24
24
|
return env.Null();
|
|
25
25
|
}
|
|
26
26
|
double ret;
|
|
27
|
-
char serr [AS_MAXCH];
|
|
27
|
+
char serr [AS_MAXCH] = "";
|
|
28
28
|
int32 flag = swe_rise_trans_true_hor(
|
|
29
29
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
30
30
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -18,7 +18,7 @@ Napi::Value sweph_sol_eclipse_how(const Napi::CallbackInfo& info) {
|
|
|
18
18
|
return env.Null();
|
|
19
19
|
}
|
|
20
20
|
double attr [20];
|
|
21
|
-
char serr [AS_MAXCH];
|
|
21
|
+
char serr [AS_MAXCH] = "";
|
|
22
22
|
int32 flag = swe_sol_eclipse_how(
|
|
23
23
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
24
24
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -14,7 +14,7 @@ Napi::Value sweph_sol_eclipse_when_glob(const Napi::CallbackInfo& info) {
|
|
|
14
14
|
return env.Null();
|
|
15
15
|
}
|
|
16
16
|
double ret [10];
|
|
17
|
-
char serr [AS_MAXCH];
|
|
17
|
+
char serr [AS_MAXCH] = "";
|
|
18
18
|
int32 flag = swe_sol_eclipse_when_glob(
|
|
19
19
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
20
20
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -20,7 +20,7 @@ Napi::Value sweph_sol_eclipse_when_loc(const Napi::CallbackInfo& info) {
|
|
|
20
20
|
}
|
|
21
21
|
double ret [10];
|
|
22
22
|
double attr [20];
|
|
23
|
-
char serr [AS_MAXCH];
|
|
23
|
+
char serr [AS_MAXCH] = "";
|
|
24
24
|
int32 flag = swe_sol_eclipse_when_loc(
|
|
25
25
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
26
26
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -13,7 +13,7 @@ Napi::Value sweph_sol_eclipse_where(const Napi::CallbackInfo& info) {
|
|
|
13
13
|
}
|
|
14
14
|
double geopos [10];
|
|
15
15
|
double attr [20];
|
|
16
|
-
char serr [AS_MAXCH];
|
|
16
|
+
char serr [AS_MAXCH] = "";
|
|
17
17
|
int32 flag = swe_sol_eclipse_where(
|
|
18
18
|
info[0].As<Napi::Number>().DoubleValue(),
|
|
19
19
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -17,7 +17,7 @@ Napi::Value sweph_utc_to_jd(const Napi::CallbackInfo& info) {
|
|
|
17
17
|
return env.Null();
|
|
18
18
|
}
|
|
19
19
|
double ret [2];
|
|
20
|
-
char serr [AS_MAXCH];
|
|
20
|
+
char serr [AS_MAXCH] = "";
|
|
21
21
|
int32 flag = swe_utc_to_jd(
|
|
22
22
|
info[0].As<Napi::Number>().Int32Value(),
|
|
23
23
|
info[1].As<Napi::Number>().Int32Value(),
|
|
@@ -30,7 +30,7 @@ Napi::Value sweph_vis_limit_mag(const Napi::CallbackInfo& info) {
|
|
|
30
30
|
Napi::TypeError::New(env, args[4].second).ThrowAsJavaScriptException();
|
|
31
31
|
return env.Null();
|
|
32
32
|
}
|
|
33
|
-
char serr [AS_MAXCH];
|
|
33
|
+
char serr [AS_MAXCH] = "";
|
|
34
34
|
double ret [8];
|
|
35
35
|
int32 flag = swe_vis_limit_mag(
|
|
36
36
|
info[0].As<Napi::Number>().DoubleValue(),
|
package/src/sweph.cpp
CHANGED
|
@@ -106,7 +106,7 @@ bool sweph_is_type(int type, Napi::Value data) {
|
|
|
106
106
|
|
|
107
107
|
bool sweph_type_check(const std::pair<int, const char*> types[], const Napi::CallbackInfo& info) {
|
|
108
108
|
Napi::Env env = info.Env();
|
|
109
|
-
if(info.Length() < types[0].first) {
|
|
109
|
+
if((int)info.Length() < types[0].first) {
|
|
110
110
|
Napi::TypeError::New(env, types[0].second).ThrowAsJavaScriptException();
|
|
111
111
|
return false;
|
|
112
112
|
}
|
package/.github/FUNDING.yml
DELETED
package/deps/swisseph.gyp
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"targets": [
|
|
3
|
-
{
|
|
4
|
-
"target_name": "swisseph",
|
|
5
|
-
"type": "static_library",
|
|
6
|
-
"direct_dependent_settings": {
|
|
7
|
-
"include_dirs": [
|
|
8
|
-
"swisseph"
|
|
9
|
-
]
|
|
10
|
-
},
|
|
11
|
-
"sources": [
|
|
12
|
-
"swisseph/swecl.c",
|
|
13
|
-
"swisseph/swedate.c",
|
|
14
|
-
"swisseph/swehel.c",
|
|
15
|
-
"swisseph/swehouse.c",
|
|
16
|
-
"swisseph/swejpl.c",
|
|
17
|
-
"swisseph/swemmoon.c",
|
|
18
|
-
"swisseph/swemplan.c",
|
|
19
|
-
"swisseph/sweph.c",
|
|
20
|
-
"swisseph/swephlib.c"
|
|
21
|
-
],
|
|
22
|
-
"cflags": [
|
|
23
|
-
"-flto",
|
|
24
|
-
"-Ofast",
|
|
25
|
-
"-pipe"
|
|
26
|
-
],
|
|
27
|
-
"cflags_cc": [
|
|
28
|
-
"-flto",
|
|
29
|
-
"-Ofast",
|
|
30
|
-
"-pipe"
|
|
31
|
-
],
|
|
32
|
-
"msvs_settings": {
|
|
33
|
-
"VCCLCompilerTool": {
|
|
34
|
-
"AdditionalOptions": [
|
|
35
|
-
"/O2",
|
|
36
|
-
"/GL",
|
|
37
|
-
"/Gw"
|
|
38
|
-
]
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
]
|
|
43
|
-
}
|
package/docs.gif
DELETED
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|