atmosx-nwws-parser 1.0.212 → 1.0.221
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 +7 -11
- package/dist/cjs/index.cjs +192 -237
- package/dist/esm/index.mjs +192 -237
- package/package.json +2 -1
- package/src/bootstrap.ts +5 -6
- package/src/database.ts +1 -0
- package/src/dictionaries/signatures.ts +6 -0
- package/src/index.ts +1 -27
- package/src/parsers/events/api.ts +40 -29
- package/src/parsers/events/cap.ts +20 -14
- package/src/parsers/events/text.ts +17 -12
- package/src/parsers/events/ugc.ts +16 -11
- package/src/parsers/events/vtec.ts +15 -10
- package/src/parsers/events.ts +31 -44
- package/src/parsers/text.ts +1 -1
- package/src/parsers/ugc.ts +23 -14
- package/src/types.ts +10 -20
- package/src/utils.ts +0 -54
- package/test.js +6 -4
package/README.md
CHANGED
|
@@ -45,7 +45,6 @@ const parser = new AlertManager({
|
|
|
45
45
|
disable_vtec: false,
|
|
46
46
|
disable_text: false,
|
|
47
47
|
cap_only: false,
|
|
48
|
-
shapefile_coordinates: false,
|
|
49
48
|
}
|
|
50
49
|
},
|
|
51
50
|
national_weather_service_settings: {
|
|
@@ -55,6 +54,8 @@ const parser = new AlertManager({
|
|
|
55
54
|
global_settings: {
|
|
56
55
|
parent_events_only: true,
|
|
57
56
|
better_event_parsing: true,
|
|
57
|
+
shapefile_coordinates: false,
|
|
58
|
+
shapefile_skip: 10,
|
|
58
59
|
filtering: {
|
|
59
60
|
events: [`Severe Thunderstorm Warning`],
|
|
60
61
|
filtered_icao: [],
|
|
@@ -63,7 +64,7 @@ const parser = new AlertManager({
|
|
|
63
64
|
ugc_filter: [],
|
|
64
65
|
state_filter: [],
|
|
65
66
|
check_expired: true,
|
|
66
|
-
|
|
67
|
+
ignore_test_products: true,
|
|
67
68
|
location: {
|
|
68
69
|
unit: `miles`
|
|
69
70
|
},
|
|
@@ -83,11 +84,12 @@ To use the NOAA Weather Wire Service (NWWS). You would need to obtain credential
|
|
|
83
84
|
3. Submit the form and wait for approval. You will receive your NWWS credentials via email.
|
|
84
85
|
|
|
85
86
|
## Events and Listeners
|
|
87
|
+
> All events are in GeoJSON.
|
|
86
88
|
|
|
87
|
-
### Event `
|
|
88
|
-
Triggered when a batch of new alerts are received and processed.
|
|
89
|
+
### Event `onEvents`
|
|
90
|
+
Triggered when a batch of new alerts are received and processed.
|
|
89
91
|
```javascript
|
|
90
|
-
parser.on(`
|
|
92
|
+
parser.on(`onEvents`, (alerts) => {
|
|
91
93
|
console.log(`Received ${alerts.length} new alerts.`);
|
|
92
94
|
alerts.forEach(alert => {
|
|
93
95
|
console.log(`${alert.properties.event} for ${alert.properties.locations}`);
|
|
@@ -149,12 +151,6 @@ Sets the display name for the XMPP client. This requires reconnection to take ef
|
|
|
149
151
|
parser.setDisplayName(`My Weather Parser`);
|
|
150
152
|
```
|
|
151
153
|
|
|
152
|
-
### Function `setCurrentLocation(name, {latitude, longitude})`
|
|
153
|
-
Sets the current location for the parser, which can be used for location-based filtering.
|
|
154
|
-
```javascript
|
|
155
|
-
parser.setCurrentLocation(`My Location`, {34.05, -118.25 });
|
|
156
|
-
```
|
|
157
|
-
|
|
158
154
|
### Function `createEasAudio(description, header)`
|
|
159
155
|
Generates an EAS audio file based on the provided description and header. Audio file will be located based on settings provided in the global_settings.eas_settings object.
|
|
160
156
|
```javascript
|