Weather-emoji

luctst

Lucas.T

Posted on July 12, 2021

Weather-emoji

Get the weather with an emoji ☀️ 🌈


Install:

Run

npm install -D weather-emoji
Enter fullscreen mode Exit fullscreen mode

Import the package:

const weatherEmoji = require('weather-emoji');
Enter fullscreen mode Exit fullscreen mode

Note - We're using the openweather API to fetch the data, it requires that you create a key, click on the link to register and generate your key.

Usage:

const WeatherEmoji = require("weather-emoji");
const weatherEmoji = new WeatherEmoji(secretApiKey);

const emojiParis = weatherEmoji.getWeather("paris", true).then(data => data);

console.log(emojiParis.emoji); // return emoji
Enter fullscreen mode Exit fullscreen mode

With async / await:

const WeatherEmoji = require("weather-emoji");

(async () => {
    const weatherEmoji = new WeatherEmoji(secretApiKey);

    const emojiNewYork = await weatherEmoji.getWeather("new york", true);
    console.log(emojiNewYork.emoji);
})()
Enter fullscreen mode Exit fullscreen mode

More informations here - https://www.npmjs.com/package/weather-emoji

Happy coding ✨🧑‍💻

💖 💪 🙅 🚩
luctst
Lucas.T

Posted on July 12, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Weather-emoji
showdev Weather-emoji

July 12, 2021