-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
rodney
authored and
rodney
committed
Nov 12, 2019
1 parent
a3f06bc
commit ae5ab7c
Showing
2 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,27 @@ | ||
# faa-parser | ||
Node module for parsing various FAA data files. | ||
|
||
```javascript | ||
const FAA = require('../index') | ||
const Parser = FAA.Parser | ||
|
||
var parser = new Parser(FAA.Airport) | ||
|
||
// https://www.faa.gov/air_traffic/flight_info/aeronav/aero_data/NASR_Subscription_2019-06-20 | ||
var sourceFile = 'path/to/APT.txt'; | ||
|
||
var promise = parser.parse(sourceFile, airport => { | ||
return new Promise((resolve, revoke) => { | ||
if (airport.state === 'NV') | ||
console.log(JSON.stringify(airport, null, 2)) | ||
resolve(); | ||
}); | ||
}); | ||
|
||
promise.then(() => { | ||
console.log('It worked!') | ||
done() | ||
}).catch((err) => { | ||
throw err | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters