metar-taf-parser 1.0.1 → 1.0.2
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 +21 -25
- package/package.json +12 -3
package/README.md
CHANGED
|
@@ -1,40 +1,36 @@
|
|
|
1
|
-
# metar-taf-parser
|
|
1
|
+
# ✈️ [metar-taf-parser](https://aeharding.github.io/metar-taf-parser)
|
|
2
2
|
|
|
3
3
|
This is a port of [python-metar-taf-parser](https://github.com/mivek/python-metar-taf-parser) to Typescript. It's fully typed and tested with i18n support, and can run on Node or the browser.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[Check out the demo here](https://aeharding.github.io/metar-taf-parser)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Installation
|
|
8
8
|
|
|
9
|
-
```
|
|
10
|
-
|
|
9
|
+
```sh
|
|
10
|
+
yarn add metar-taf-parser
|
|
11
|
+
# or
|
|
12
|
+
npm i --save metar-taf-parser
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
11
16
|
|
|
12
|
-
|
|
13
|
-
// For example: https://www.aviationweather.gov/dataserver
|
|
14
|
-
// const { metar } = await myService.getAirportData('KMSN')
|
|
17
|
+
### Parse a METAR
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
```ts
|
|
20
|
+
import { parseMetar } from 'metar-taf-parser'
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
const metar = parseMetar(rawMetarString)
|
|
20
23
|
```
|
|
21
24
|
|
|
22
|
-
### Parse TAF
|
|
25
|
+
### Parse a TAF
|
|
23
26
|
|
|
24
27
|
```ts
|
|
25
28
|
import { parseTAF } from 'metar-taf-parser'
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
// For example: https://www.aviationweather.gov/dataserver
|
|
29
|
-
// const { taf } = await myService.getAirportData('KMSN')
|
|
30
|
-
|
|
31
|
-
// Readily serializable
|
|
32
|
-
const tafResult = parseTAF(taf)
|
|
33
|
-
|
|
34
|
-
// Your code here 🚀
|
|
30
|
+
const taf = parseTAF(rawTAFString)
|
|
35
31
|
```
|
|
36
32
|
|
|
37
|
-
|
|
33
|
+
## i18n
|
|
38
34
|
|
|
39
35
|
```ts
|
|
40
36
|
import { parseMetar } from 'metar-taf-parser'
|
|
@@ -45,16 +41,16 @@ const { metar } = await myService.getAirportData('KMSN')
|
|
|
45
41
|
const metarResult = parseMetar(metar, { locale: de })
|
|
46
42
|
```
|
|
47
43
|
|
|
48
|
-
## Contributing
|
|
49
|
-
|
|
50
|
-
This project is intended to provide feature parity with [python-metar-taf-parser](https://github.com/mivek/python-metar-taf-parser) and will only accept PRs to maintain feature parity or to fix inconsistencies with that project.
|
|
51
|
-
|
|
52
44
|
## Development
|
|
53
45
|
|
|
54
46
|
### Example site
|
|
55
47
|
|
|
56
48
|
Please see [the example site README.md](example/README.md).
|
|
57
49
|
|
|
50
|
+
## Contributing
|
|
51
|
+
|
|
52
|
+
This project is intended to provide feature parity with [python-metar-taf-parser](https://github.com/mivek/python-metar-taf-parser) and will only accept PRs to maintain feature parity or to fix inconsistencies with that project.
|
|
53
|
+
|
|
58
54
|
## Acknowledgment
|
|
59
55
|
|
|
60
56
|
This software port was made possible due to the fantastic work of [@mivek](https://github.com/mivek) in [python-metar-taf-parser](https://github.com/mivek/python-metar-taf-parser). If you like this project, please [consider buying @mivek a coffee](https://ko-fi.com/mivek).
|
package/package.json
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "metar-taf-parser",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Parse METAR and TAF
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Parse METAR and TAF reports",
|
|
5
|
+
"homepage": "https://aeharding.github.io/metar-taf-parser",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"aviation",
|
|
8
|
+
"weather",
|
|
9
|
+
"metar",
|
|
10
|
+
"taf",
|
|
11
|
+
"report",
|
|
12
|
+
"deserialize"
|
|
13
|
+
],
|
|
5
14
|
"main": "./dist/index.js",
|
|
6
15
|
"types": "./dist/index.d.ts",
|
|
7
16
|
"author": "Alexander Harding <2166114+aeharding@users.noreply.github.com>",
|
|
@@ -16,7 +25,7 @@
|
|
|
16
25
|
"start": "node --experimental-specifier-resolution=node --loader ts-node/esm lib",
|
|
17
26
|
"check-types": "tsc --noEmit",
|
|
18
27
|
"check-formatting": "prettier --check '**/*.{js,json,css,md,scss,tsx,ts}'",
|
|
19
|
-
"watch": "watch 'yarn build'
|
|
28
|
+
"watch": "watch 'yarn build' src",
|
|
20
29
|
"test": "jest --coverage",
|
|
21
30
|
"test-watch": "jest --watch --coverage",
|
|
22
31
|
"prepublishOnly": "yarn build"
|