aeharding/gsl-parser

src/index.ts:9:20 - error TS2304: Cannot find name 'asciiReport'

Closed this issue · 1 comments

*I'm very new to TypeScript, so this might just be my oversight.

I'm trying to parse GSL formatted data with your parser. I understand the readme, however when using the example code in index.ts the command line doesn't quite understand the asciiReport variable. Is that supposed to be replaced with a txt file containing the GSL output from noaa.gov?

The code:

import parse from 'gsl-parser'

// fetch the ascii report from
// https://rucsoundings.noaa.gov/get_soundings.cgi
//
// documentation on parameters here:
// https://rucsoundings.noaa.gov/text_sounding_query_parameters.pdf

const data = parse(asciiReport)

console.log(data)

Command line output:

> my-app@1.0.0 start
> npm run build && node dist/index.js


> my-app@1.0.0 build
> npx tsc

src/index.ts:9:20 - error TS2304: Cannot find name 'asciiReport'.

9 const data = parse(asciiReport)
                     ~~~~~~~~~~~


Found 1 error in src/index.ts:9

I extend my sincere appreciation beforehand for any assistance you might offer in facilitating in helping me understand the parser's functionality.

Hi there! Yes, that's correct. You pass in the payload (as a string) of the GSL report at the first parameter of the parse() function. Let me know if you have any other questions.