From 8ca193763012098a23306cbb08cf9776d8b303dd Mon Sep 17 00:00:00 2001 From: Matthias Pfeil Date: Tue, 19 Nov 2019 11:35:08 +0100 Subject: [PATCH] Update examples --- example.js | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/example.js b/example.js index d4152d7..ae43a6d 100644 --- a/example.js +++ b/example.js @@ -1,25 +1,12 @@ const luqs = require('.') -luqs() - .then(response => { - console.log(response) - }) - .catch(error => { - console.log(error) - }) +const run = async () => { + const stations = await luqs() + console.log(stations) + const unna = await luqs.station('unna') + console.log(unna) + const currentMeasurements = await luqs.aktuell() + console.log(currentMeasurements) +} -luqs.station('unna') - .then(response => { - console.log(response) - }) - .catch(error => { - console.log(error) - }) - -luqs.aktuell() - .then(response => { - console.log(response) - }) - .catch(error => { - console.log(error) - }) +run()