airport-data-js 1.0.0 → 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 +2 -2
- package/SECURITY.md +23 -0
- package/package.json +1 -1
- package/INSTRUCTIONS_NODE.md +0 -78
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ npm install airport-data-js
|
|
|
24
24
|
|
|
25
25
|
For detailed instructions on how to use this library in different environments, please refer to the following links:
|
|
26
26
|
|
|
27
|
-
- [Node.js Instructions](
|
|
27
|
+
- [Node.js Instructions](https://github.com/aashishvanand/airport-data-js/blob/nodejs-sample/README.md)
|
|
28
28
|
- [React Instructions](./INSTRUCTIONS_REACT.md) *(Coming Soon)*
|
|
29
29
|
|
|
30
30
|
## Usage
|
|
@@ -158,7 +158,7 @@ npm test
|
|
|
158
158
|
2. **Issue**: "Error: Automatic publicPath is not supported in this browser".
|
|
159
159
|
**Solution**: Ensure that you're using the library in a supported environment (Node.js or a modern browser).
|
|
160
160
|
|
|
161
|
-
If you encounter other issues, consider raising an issue on the [GitHub repository](https://github.com/
|
|
161
|
+
If you encounter other issues, consider raising an issue on the [GitHub repository](https://github.com/aashishvanand/airport-data-js/issues).
|
|
162
162
|
|
|
163
163
|
## License
|
|
164
164
|
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
Currently, only the latest major version of `airport-data-js` (or whatever you name your package) is being actively supported with security updates.
|
|
6
|
+
|
|
7
|
+
## Reporting a Vulnerability
|
|
8
|
+
|
|
9
|
+
Your security is of utmost importance. If you believe you've found a security issue in `airport-data-js`, please notify me. I appreciate your efforts in responsibly disclosing your findings and will make every effort to acknowledge and address them as soon as possible.
|
|
10
|
+
|
|
11
|
+
### Disclosure Policy
|
|
12
|
+
|
|
13
|
+
- Please give me a detailed overview of the potential issue, avoiding too much technical jargon if possible.
|
|
14
|
+
- Let me know as soon as possible upon discovery of a potential security issue.
|
|
15
|
+
- Provide me with a reasonable amount of time to address the issue before any disclosure to the public or a third-party.
|
|
16
|
+
- Make a good faith effort to avoid privacy violations, destruction of data, and interruption or degradation of the service.
|
|
17
|
+
|
|
18
|
+
### Process
|
|
19
|
+
|
|
20
|
+
1. Email the details of your findings to [aashishvanand@gmail.com](mailto:aashishvanand@gmail.com). Please use a descriptive subject line.
|
|
21
|
+
2. You'll receive a response from me within 48 hours acknowledging your email.
|
|
22
|
+
3. I will investigate the issue and strive to keep you informed about my progress towards a fix.
|
|
23
|
+
4. Once the issue is resolved, I may ask you to validate the solution.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "airport-data-js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "A comprehensive library providing easy retrieval of airport data based on IATA, ICAO, city codes, country codes, and continents.",
|
|
6
6
|
"main": "dist/airports.bundle.js",
|
package/INSTRUCTIONS_NODE.md
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
# Airports - Node.js Usage Instructions
|
|
2
|
-
|
|
3
|
-
This document provides step-by-step instructions on how to use the `airport-data-js` library in a Node.js environment.
|
|
4
|
-
|
|
5
|
-
## Table of Contents
|
|
6
|
-
|
|
7
|
-
1. [Setting Up](#setting-up)
|
|
8
|
-
2. [Integrating the Library](#integrating-the-library)
|
|
9
|
-
3. [Fetching Data](#fetching-data)
|
|
10
|
-
4. [Error Handling](#error-handling)
|
|
11
|
-
5. [Additional Notes](#additional-notes)
|
|
12
|
-
|
|
13
|
-
## Setting Up
|
|
14
|
-
|
|
15
|
-
1. **Initialize a new Node.js project (if you haven't already):**
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm init -y
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
2. **Install the `airport-data-js` library:**
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
npm install airport-data-js
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Integrating the Library
|
|
28
|
-
|
|
29
|
-
1. **Import the library in your Node.js script:**
|
|
30
|
-
|
|
31
|
-
```javascript
|
|
32
|
-
const airports = require('airport-data-js');
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Fetching Data
|
|
36
|
-
|
|
37
|
-
Use the available methods to fetch airport data:
|
|
38
|
-
|
|
39
|
-
1. **By IATA Code:**
|
|
40
|
-
|
|
41
|
-
```javascript
|
|
42
|
-
const dataByIata = await airports.getAirportByIata('MAA');
|
|
43
|
-
console.log(dataByIata);
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
2. **By ICAO Code:**
|
|
47
|
-
|
|
48
|
-
```javascript
|
|
49
|
-
const dataByIcao = await airports.getAirportByIcao('VOMM');
|
|
50
|
-
console.log(dataByIcao);
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
3. **By City Code:**
|
|
54
|
-
|
|
55
|
-
```javascript
|
|
56
|
-
const dataByCity = await airports.getAirportByCityCode('NYC');
|
|
57
|
-
console.log(dataByCity);
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
... and so on for other methods.
|
|
61
|
-
|
|
62
|
-
## Error Handling
|
|
63
|
-
|
|
64
|
-
Each method returns a promise. Handle errors using `try/catch`:
|
|
65
|
-
|
|
66
|
-
```javascript
|
|
67
|
-
try {
|
|
68
|
-
const data = await airports.getAirportByIata('AAA');
|
|
69
|
-
console.log(data);
|
|
70
|
-
} catch (error) {
|
|
71
|
-
console.error('Failed to fetch data:', error.message);
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Additional Notes
|
|
76
|
-
|
|
77
|
-
- The library fetches data based on the provided codes. Ensure the codes are valid and in the expected format.
|
|
78
|
-
- For any issues or further documentation, refer to the main [README.md](./README.md).
|