Skip to content

Commit

Permalink
docs: update readme and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroentvb committed May 17, 2022
1 parent 36ba01e commit 834747a
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 37 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# v5.0.0-beta.1
### ⚠️ Breaking changes
* Upgrade to puppeteer 14
* Convert to esm
* Remove name field from data output

### Other changes
* Add eslint config
* Use functions instead of classes

# v4.1.4
* Update dependencies

# v4.1.3
* Update dependencies

Expand Down
70 changes: 34 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Wind-scrape can scrape wind forecasts from the following websites:
* Windguru (spots & custom spots (custom spots requires windguru PRO))
* Windy

> ⚠️ Wind scrape is esm only
## Table of contents
* [Installation](#installation)
* [Usage](#usage)
Expand All @@ -48,20 +50,21 @@ Releases can be found [here](https://github.com/jeroentvb/wind-scrape/releases).

## Usage
```js
const scrape = require('wind-scrape')

// TypeScript
import * as scrape from 'wind-scrape'

// Or import a specific scrape function, e.g.

import { windfinder } from 'wind-scrape'

// Scrape windfinder spot
scrape.windfinder('tarifa')
.then(data => console.log(data)
.catch(err => console.error(err)
.then(data => console.log(data))
.catch(err => console.error(err))

// Scrape windguru spot
scrape.windguru(43)
.then(data => console.log(data)
.catch(err => console.error(err)
.then(data => console.log(data))
.catch(err => console.error(err))

// Scrape custom windguru spot
scrape.customWindguru({
Expand All @@ -71,18 +74,18 @@ scrape.customWindguru({
username: 'your windguru username',
password: 'your secondary windguru pasword'
})
.then(data => console.log(data)
.catch(err => console.error(err)
.then(data => console.log(data))
.catch(err => console.error(err))

// Scrape windy spot
scrape.windy(36.012, -5.611)
.then(data => console.log(data)
.catch(err => console.error(err)
.then(data => console.log(data))
.catch(err => console.error(err))

// Scrape windreport of a windguru spot
scrape.windReport('tarifa')
.then(data => console.log(data)
.catch(err => console.error(err)
.then(data => console.log(data))
.catch(err => console.error(err))
```

### windfinder
Expand Down Expand Up @@ -133,7 +136,6 @@ Scrapes data from give windguru spot. Optionally get a specific model. Returns a
```json
{
"spot": {
"name": "Spain - Tarifa",
"coordinates": {
"lat": "36",
"lng": "-5.65"
Expand Down Expand Up @@ -251,27 +253,24 @@ Scrapes data for a custom location. Returns a promise which resolves in an objec
<summary>Windguru data format</summary>

```json
{
"name": "Windy",
"models": [
{
"name": "ECMWF 9km",
"days": [
{
"date": "07-04-2019",
"hours": [
{
"hour": 9,
"windspeed": 20,
"windgust": 30,
"winddirection": 278
}
]
}
]
}
]
}
[
{
"name": "ECMWF 9km",
"days": [
{
"date": "07-04-2019",
"hours": [
{
"hour": 9,
"windspeed": 20,
"windgust": 30,
"winddirection": 278
}
]
}
]
}
]
```
</details>

Expand All @@ -292,7 +291,6 @@ Gets the report data for a windfinder spot report. Returns a promise which resol

```json
{
"name": "Windfinder report",
"spot": "tarifa",
"report": [
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wind-scrape",
"version": "4.1.4",
"version": "5.0.0-beta.1",
"description": "Scrape wind forecast from a few websites",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down

0 comments on commit 834747a

Please sign in to comment.