Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
clearweatherapi
Advanced tools
Clear Weather API transforms OpenWeather Map OneCall data into human-readable code so you can get to building apps faster.
I built this library to make it easier to use the ClearWeather API.
Learn more about Clear Weather API.
You need an OpenWeather Map API key to use this library, and you can get one by signing up at Open Weather Map.
You can get more information about the One Call API at Open Weather Map Onecall.
npm
npm install clearweatherapi
yarn
yarn add clearweatherapi
const options = {
openWeatherApiKey: 'YOUR_OPENWEATHER_API_KEY',
userId: 'YOUR-CLEATHERWEATHERAPI-USERID',
coords: {
latitude: '',
longitude: '',
},
cacheTime: 4800,
formated: false,
lang: 'en',
units: 'imperial',
version: '3.0',
};
const weather = new Weather(options);
To get more information about what each method returns refer to the docs.
const current = await weather.fetchCurrentWeather();
const daily = await weather.fetchDailyWeather();
const hourly = await weather.fetchHourly();
const onecall = await weather.fetchOneCall();
const alerts = await weather.fetchAlerts();
Icons are available for premium users and can be found in each weather data object.
If you are not a premium user you can get more information on how to fetch the icons here.
Name | Type | Required | Description |
---|---|---|---|
openWeatherApiKey | string | true | Your OpenWeatherMap API key. You can get a free API key here. |
userId | string | true | Your Clear Weather API user ID Sign up at Clear Weather API to get you free user id. |
coords | object | true | The coordinates to get weather data for. This is an object with latitude and longitude properties. |
cacheTime | number | false | The time in seconds to cache data for. Maximum time is 43200 (12 hours) at a time (Premium) |
formated | boolean | false | Whether or not to format the data (Premium) |
units | string | false | The units to use for the data. Default is imperial . Options are metric , imperial , and standard |
version | string | false | The version of the API to use. Default is 3.0 . Options are 2.5 and 3.0 |
FAQs
Clear Weather API is a wrapper for OpenWeather Map API, designed to simplify the process of fetching and handling weather data. With an easy-to-use interface, this package offers premium features such as data transformation for more human-readable output,
The npm package clearweatherapi receives a total of 1 weekly downloads. As such, clearweatherapi popularity was classified as not popular.
We found that clearweatherapi demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.