# surfsup

> Node wrapper for Marine/Sailing/Surfing Weather API

Latest version **0.6.0** (published 2014-10-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install surfsup
pnpm add surfsup
yarn add surfsup
bun add surfsup
```

## 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.6.0 |
| Published | 2014-10-25 |
| First published | 2014-10-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Mike Wilcox |
| Maintainers | mikedub |
| Keywords | marine, sailing, surfing, coastal, weather, ocean, waves, storm, storms, hurricane, typhoon, beach, tsunami |

## Links

- npm: https://www.npmjs.com/package/surfsup
- Repository: https://github.com/mjw56/surfsup
- Issues: https://github.com/mjw56/surfsup/issues
- npm.io page: https://npm.io/package/surfsup

## Dependencies (1)

- [request-promise](https://npm.io/package/request-promise.md) ^0.2.2

## Recent versions

- 0.6.0 (latest) — 2014-10-25
- 0.5.0 — 2014-10-17
- 0.4.0 — 2014-10-17
- 0.3.0 — 2014-10-15
- 0.2.0 — 2014-10-14
- 0.1.0 — 2014-10-14

## README

surfsup
=======

Node module for Marine/Sailing/Surfing Weather API

![the beach](/lbi.jpeg)

### Installation:

```sh
npm install surfsup
```

### Usage:

First, you'll have to grab an API key for yourself. No need to worry, they're free. :)

https://developer.worldweatheronline.com/auth/register

Then set it as an environment variable on your machine

OSX:

```sh
export WEATHER_KEY=<your key here>
```
Windows:

```sh
SET WEATHER_KEY=<your key here>
```


**Get Local Weather**

```sh
var SurfsUp = require('surfsup');

var su = new SurfsUp();

su.getLocalWeather({ q: 'Teahupoo, Tahiti', format: 'json' }).then(function(response) {
  console.log(response);
});

```

Available Input Parameters:

| Parameter | Type | Description |
| --------- | ---- | ----------- |
|     q     | string | Pass Latitude/Longitude (decimal degree) of sea or ocean point |
|  format   | string | Output format as JSON or XML |
|    fx     | string | (Optional) Allows you to enable or disable normal weather output. The possible values are yes or no. By default it is yes. E.g:- fx=yes or fx=no |
| includeLocation | string | (Optional) Returns the nearest marine weather point for which the weather data is returned for a given lat/lon value. The possible values are yes or no. By default it is no. E.g:- includeLocation=yes or includeLocation=no |
|  callback | string | (Optional) Only to be used for json callback feature. E.g:- callback=function_name |
|   lang    | string | (Optional) Returns weather description text in the language of your choice. E.g:- lang=ar (Arabic). Visit Multilingual support page for more information: http://www.worldweatheronline.com/weather-api-multilingual.aspx |


**Get Marine Weather**

```sh
var SurfsUp = require('surfsup');

var su = new SurfsUp();

su.getMarineWeather({ q: '45,-2', format: 'json' }).then(function(response) {
  console.log(response);
});

```

Available Input Parameters:

| Parameter | Type | Description |
| --------- | ---- | ----------- |
|     q     | string | Pass Latitude/Longitude (decimal degree) of sea or ocean point |
|   format  | string | Output format as JSON or XML |
|    fx     | string | (Optional) Allows you to enable or disable normal weather output. The possible values are yes or no. By default it is yes. E.g:- fx=yes or fx=no |
| includeLocation | string | (Optional) Returns the nearest marine weather point for which the weather data is returned for a given lat/lon value. The possible values are yes or no. By default it is no. E.g:- includeLocation=yes or includeLocation=no |
| callback | string | (Optional) Only to be used for json callback feature. E.g:- callback=function_name |
| lang | string | (Optional) Returns weather description text in the language of your choice. E.g:- lang=ar (Arabic). Visit Multilingual support page for more information: http://www.worldweatheronline.com/weather-api-multilingual.aspx |


**Get Ski and Mountain Weather**

```sh
var SurfsUp = require('surfsup');

var su = new SurfsUp();

su.getSkiMountainWeather({ q: 'Salt Lake City', format: 'json' }).then(function(response) {
  console.log(response);
});

```

Available Input Parameters:

| Parameter | Type | Description |
| --------- | ---- | ----------- |
|     q     | string | Pass US Zipcode, UK Postcode, Canada Postalcode, IP address, Latitude/Longitude (decimal degree) or city name |
|  format   | string | Output format as JSON or XML |
|    extra     | string | (Optional) It allows to request some additional information in the feed return. Possible values are isDayTime, utcDateTime. Two or more values can be passed as comma separated. |
| includeLocation | string | (Optional) Returns the nearest ski and mountain weather point for which the weather data is returned for a given postcode, zipcode, city name and lat/lon values. The possible values are yes or no. By default it is no. E.g:- includeLocation=yes or includeLocation=no |
|  callback | string | (Optional) Only to be used for json callback feature. E.g:- callback=function_name |
|   lang    | string | (Optional) Returns weather description text in the language of your choice. E.g:- lang=ar (Arabic). Visit Multilingual support page for more information: http://www.worldweatheronline.com/weather-api-multilingual.aspx |


**Get Time Zone Data**

```sh
var SurfsUp = require('surfsup');

var su = new SurfsUp();

su.getTimeZoneData({ q: 'Lima, Peru', format: 'json' }).then(function(response) {
  console.log(response);
});

```

Available Input Parameters:

| Parameter | Type | Description |
| --------- | ---- | ----------- |
|     q     | string | Pass US Zipcode, UK Postcode, Canada Postalcode, IP address, Latitude/Longitude (decimal degree) or city name |
|  format   | string | Output format as JSON or XML |
|  callback | string | (Optional) Only to be used for json callback feature. E.g:- callback=function_name |

## Compile TypeScript

```sh
gulp compile
```

## Tests

```sh
gulp tests
```

## Issues
[Issues](https://github.com/mjw56/surfsup/issues)

## License
[MIT License](https://raw.githubusercontent.com/mjw56/surfsup/master/LICENSE)

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