npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ts-metar-parser

v1.0.3

Published

A simple METAR parser

Downloads

6

Readme

✈️ TS METAR Parser

Parse METAR information into structured TypeScript objects. The structure of the returned object is closely related to the API response of CheckWX.

Installation

Install using npm:

npm install ts-metar-parser --save

Install using pnpm:

pnpm install ts-metar-parser

Install using yarn:

yarn add ts-metar-parser

Install using bun:

bun add ts-metar-parser

Functionality

This METAR parser returns the following parts of a METAR string:

  • ICAO code
  • Date / time
  • Wind speed (in kts, mps) & direction
  • Visibility (in meters and miles)
  • Weather phenomena
  • Clouds
  • Temperature (in °C & °F) & humidity
  • Barometer pressure (in InHg, kpa & mb)

Code Example

import { parseMETAR } from 'ts-metar-parser';

const metarString =
  'KSEA 150253Z 23008KT 10SM FEW040 FEW150 SCT250 13/06 A3002 RMK AO2 SLP172 T01330061 53006';

const metarObject = parseMETAR(metarString);

console.log(metarObject);

…returns:

{
  "raw_text": "KSEA 150253Z 23008KT 10SM FEW040 FEW150 SCT250 13/06 A3002 RMK AO2 SLP172 T01330061 53006",
  "raw_parts": [
    "KSEA",
    "150253Z",
    "23008KT",
    "10SM",
    "FEW040",
    "FEW150",
    "SCT250",
    "13/06",
    "A3002",
    "RMK",
    "AO2",
    "SLP172",
    "T01330061",
    "53006"
  ],
  "flight_category": "VFR",
  "icao": "KSEA",
  "observed": "2024-04-15T02:53:32.114Z",
  "wind": {
    "degrees": 230,
    "speed_kts": 8,
    "speed_mps": 4.115555539550617,
    "gust_kts": 8,
    "gust_mps": 4.115555539550617
  },
  "visibility": {
    "miles": "10",
    "miles_float": 10,
    "meters": "16000",
    "meters_float": 16093.44
  },
  "clouds": [
    {
      "code": "FEW",
      "base_feet_agl": 4000,
      "base_meters_agl": 1219.2
    },
    {
      "code": "FEW",
      "base_feet_agl": 15000,
      "base_meters_agl": 4572
    },
    {
      "code": "SCT",
      "base_feet_agl": 25000,
      "base_meters_agl": 7620
    }
  ],
  "temperature": {
    "celsius": 13,
    "fahrenheit": 55.400000000000006
  },
  "dewpoint": {
    "celsius": 6,
    "fahrenheit": 42.8
  },
  "humidity_percent": 62.48465840713307,
  "barometer": {
    "hg": 30.02,
    "kpa": 101.65939777999999,
    "mb": 1016.5939778
  },
  "ceiling": {
    "code": "SCT",
    "feet_agl": 25000,
    "meters_agl": 7620
  }
}

More Information on METAR

Wikipedia has an article on METAR information explaining the very basics.

These sites make METAR information publicly available:

  • https://en.allmetsat.com/metar-taf/
  • https://aviationweather.gov/metar
  • https://metars.com/

Status

NPM Version

NPM dev or peer Dependency Version

Legal Stuff

Original Author: Frank Boës

Update Author: Jared Hernandez