From 834747a993bac4e5e185dcf2e63c753d39aa649e Mon Sep 17 00:00:00 2001 From: jeroentvb <36192730+jeroentvb@users.noreply.github.com> Date: Tue, 17 May 2022 20:14:00 +0200 Subject: [PATCH] docs: update readme and changelog --- CHANGELOG.md | 13 ++++++++++ README.md | 70 +++++++++++++++++++++++++--------------------------- package.json | 2 +- 3 files changed, 48 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d701c3..599942c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 2282193..f610b31 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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({ @@ -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 @@ -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" @@ -251,27 +253,24 @@ Scrapes data for a custom location. Returns a promise which resolves in an objec Windguru data format ```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 + } + ] + } + ] + } +] ``` @@ -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": [ { diff --git a/package.json b/package.json index 83de6b9..6ce8633 100644 --- a/package.json +++ b/package.json @@ -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",