
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@warnick/forecast-js
Advanced tools
A small weather app using data from the National Weather Service (NWS), OpenWeatherMap, and Weatherbit.
Using Vue for data binding this app provides both current data, forecast predictions, and weather map for a ZIP code in the United States. For your application to work properly you will need to sign-up and get an API key for OpenWeatherMap and Weatherbit. For Both of these services the library relies on the free level of API use. If your app become popular and you are making more than the allowed calls per day you will need to pay for each of these services.
This library is markup agnostic and simply provides an object you can inject into your design.
Before you begin there are a few things you need.
Create a file in the root of your application called keys.js
this file should contain your API keys:
var Keys = {
openweathermap: "--------------------------------",
weatherbit: "--------------------------------"
}
Replace the ----------- with your key for each of the services. And make sure Keys
is capitalized.
Import the library into the head of your index.html
file.
<script src="keys.js"></script>
<script src="https://unpkg.com/@warnick/forecast-js/js/forecast.min.js" defer></script>
<link rel="stylesheet" href="https://unpkg.com/@warnick/forecast-js/css/forecast.css">
<link rel="stylesheet" href="/style.css">
In the body of your HTML, everything should be within a <div class="results" id="app">
<body>
<div class="results" id="app">
</div>
</body>
To trigger the fetching of data you will need to use the input for ZIP code.
<input placeholder="Enter Your ZIP Code" v-on:input="zip_trigger" name="name" id="zip" />
Use the NPM package manager to install forecast-js. For ----
npm install --save @warnick/forecast-js
Simply, include the CDN links in the head of your HTML. (See above for typical use).
<script src="https://unpkg.com/@warnick/forecast-js/js/forecast.min.js" defer></script>
<link rel="stylesheet" href="https://unpkg.com/@warnick/forecast-js/css/forecast.css">
There are six main categories of information: location, time, alerts, current, hourly, and forecast. Within each of these there are a myriad of pieces of data you can implement into your application.
This is based on the zip
The following icons are based on the codes and descriptions used by OpenWeatherMap.
Icon | Code | Description |
---|---|---|
![]() | 01n | clear sky |
![]() | 02n | few clouds |
![]() | 03n | scattered clouds |
![]() | 04n | broken clouds |
![]() | 09n | shower rain |
![]() | 10n | rain |
![]() | 11n | thunderstorm |
![]() | 13n | snow |
![]() | 50n | mist |
Full exmaple
https://codesandbox.io/s/forecast-js-example-959xr
Display Icon
Forecast
Updated Readme
Fixed Mixed content (http/https)
Working map using OpenLayers
Expired dependancies
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License
FAQs
Weather data using vue.js
The npm package @warnick/forecast-js receives a total of 2 weekly downloads. As such, @warnick/forecast-js popularity was classified as not popular.
We found that @warnick/forecast-js 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.