![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
openweatherapi-js-sdk
Advanced tools
Ready-to-use javascript library to consume OpenWeatherMap.org free services.
Request a free api key on http://openweathermap.org/appid.
Typescript supported ✅
Using npm:
// using npm
npm install openweatherapi-js-sdk --save
// using yarn
yarn add openweatherapi-js-sdk
Import createAPI function from the installed library, and create your api using your existing api key, if you don't have a key, request a free one on http://openweathermap.org/appid.
const { createAPI } = require("openweatherapi-js-sdk");
const api = createAPI("your_api_key");
// Short example
api
.weather
.getWeatherByCityName({
cityName: "London", // required
units: "metric", // optional
})
.then((weather) => console.log("Weather object is", weather));
// Full example
api
.weather
.getWeatherByCityName({
cityName: "London", // required
stateCode: "uk", // optional
countryCode: "GB", // optional
lang: "fr", // optional
units: "metric", // optional
})
.then((weather) => console.log("Weather object is", weather));
List of city ID 'city.list.json.gz' can be downloaded from this link http://bulk.openweathermap.org/sample.
// Example
api
.weather
.getWeatherByCityId({
cityId: 2172797, // required
lang: "fr", // optional
units: "metric", // optional
})
.then((weather) => console.log("Weather object is", weather));
// Example
api
.weather
.getWeatherByGeo({
latitude: 37, // required
longitude: 10, // required
lang: "fr", // optional
units: "metric", // optional
})
.then((weather) => console.log("Weather object is", weather));
// Example
api
.weather
.getWeatherByZipCode({
zipCode: 94040, // required
countryCode: "us", // optional
lang: "fr", // optional
units: "metric", // optional - standard, metric and imperial units are available.
})
.then((weather) => console.log("Weather object is", weather));
// Short example
api
.forecast
.getForecastByCityName({
cityName: "London", // required
units: "metric", // optional
})
.then((weather) => console.log("Weather object is", weather));
// Full example
api
.forecast
.getForecastByCityName({
cityName: "London", // required
stateCode: "uk", // optional
countryCode: "GB", // optional
lang: "fr", // optional
units: "metric", // optional
})
.then((weather) => console.log("Weather object is", weather));
List of city ID 'city.list.json.gz' can be downloaded from this link http://bulk.openweathermap.org/sample.
// Example
api
.forecast
.getForecastByCityId({
cityId: 2172797, // required
lang: "fr", // optional
units: "metric", // optional
})
.then((weather) => console.log("Weather object is", weather));
// Example
api
.forecast
.getForecastByGeo({
latitude: 37, // required
longitude: 10, // required
lang: "fr", // optional
units: "metric", // optional
})
.then((weather) => console.log("Weather object is", weather));
// Example
api
.forecast
.getForecastByZipCode({
zipCode: 94040, // required
countryCode: "us", // optional
lang: "fr", // optional
units: "metric", // optional - standard, metric and imperial units are available.
})
.then((weather) => console.log("Weather object is", weather));
This package is tested using jest. You can find the tests in the /tests folder. This package is developed using the TDD approach.
Feel free 😊 to enhance it and to add more tests 🧪🧪🧪
Feel free to contribute to this library ❤️
Thanks
FAQs
OpenWeatherMap.org Javascript SDK
The npm package openweatherapi-js-sdk receives a total of 0 weekly downloads. As such, openweatherapi-js-sdk popularity was classified as not popular.
We found that openweatherapi-js-sdk demonstrated a not healthy version release cadence and project activity because the last version was released 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.