# gd-javascript

> A wrapper to the General Data API

Latest version **0.0.2** (published 2019-05-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install gd-javascript
pnpm add gd-javascript
yarn add gd-javascript
bun add gd-javascript
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2019-05-16 |
| First published | 2019-05-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | General Data |
| Maintainers | gd_data |

## Links

- npm: https://www.npmjs.com/package/gd-javascript
- Repository: https://github.com/danielgeneral/gd-javascript
- Issues: https://github.com/danielgeneral/gd-javascript/issues
- npm.io page: https://npm.io/package/gd-javascript

## Dependencies (1)

- [node-fetch](https://npm.io/package/node-fetch.md) ^2.5.0

## Recent versions

- 0.0.2 (latest) — 2019-05-16
- 0.0.1 — 2019-05-15

## README

# gd-javascript
Javascript client to interact with General Data

## Installation
Install the package with:
    npm install gd-javascript --save

## Usage 
The package needs to be configured for production usage with the API key provided from your General Data account.

```js
let GeneralData = require('gd-javascript').GeneralData;
let gd = new GeneralData('api_key');
let largest_cities = await gd.get(gd.types["country"], "largest_city");
```

### Country
Basic country information can be extracted by using the
get function.

```js
let GeneralData = require('gd-javascript').GeneralData;
let gd = new GeneralData('api_key');
let largest_cities = await gd.get(gd.types["country"], "population");
```

### State
Basic state information can be extracted by using the get function. It should be noted that you will need to 
provide the country name associated with the state.

```js
let GeneralData = require('gd-javascript').GeneralData;
let gd = new GeneralData('api_key');
let largest_cities = await gd.get(gd.types["state"], "area");
```

### Border
You can find if a country (or state) borders another country (or state).

```js
let GeneralData = require('gd-javascript').GeneralData;
let gd = new GeneralData('api_key');

// Check if two countries share a border
let has_country_border = await gd.borders(gd.types["country"], "United States", "Mexico");

// Check if two states share a border
let has_country_border = await gd.borders(gd.types["state"], "Texas, United States", "Coahuila, Mexico");
```

---
_Source: https://npm.io/package/gd-javascript · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
