Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@warnick/forecast-js

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@warnick/forecast-js

Weather data using vue.js

  • 2.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-80%
Maintainers
1
Weekly downloads
 
Created
Source

forecast.js logo

Features

A small weather app using data from the National Weather Service (NWS)

Description

Using Vue for data binding this app provides both current data, forecast predictions, and weather map for a ZIP code in the United States. The data is obtained from the National Weather Service (NWS) which is supported through federal taxes dollars. This library is markup agnostic and simply provides an object you can inject into your design.

Usage

Download & Installation

Using NPM

Use the NPM package manager to install forecast-js. For ----

npm install --save @warnick/forecast-js
Using UNPKG

Simply, include the CDN links in the head of your HTML. (See above for typical use).

<script src="https://unpkg.com/@warnick/forecast-js/dist/js/forecast.min.js" defer></script>
<link rel="stylesheet" href="https://unpkg.com/@warnick/forecast-js/dist/css/forecast.css">

Prerequisite

Before you begin there are a few things you need.

First (Load JS)

Import the library into the head of your index.html file.

<script src="https://unpkg.com/@warnick/forecast-js/dist/js/forecast.min.js" defer></script>
<link rel="stylesheet" href="https://unpkg.com/@warnick/forecast-js/dist/css/forecast.css">
<link rel="stylesheet" href="/style.css">
Second (HTML Necessities)

In the body of your HTML, everything should be within a <div class="results" id="app">

<body>
  <div class="results" id="app">
    
  </div>
</body>
Third (ZIP Code)

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" />

Weather Object

Variables

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.

Location

This is based on the Zip Code entered in the input or retrieved from a browser cookie. This object contains:

Icons
IconCodeDescription
clear sky iconskcClear Sky
few clouds iconfewFew Clouds
scattered clouds iconsctScattered Clouds
broken clouds iconbknBroken Clouds
shower rain iconrain_showersRain Showers
rain iconrainRain
thunderstorm icontsraThunderstorm
snow iconsnowSnow
mist iconfogFog, Haze,
Smoke, Dust
Complex Icons
Clear Sky / Sunny
Icon CodeDescription
skcFair/clear
wind_skcFair/clear and windy
hotHot
Clouds
Icon CodeDescription
fewA few clouds
sctPartly cloudy
bknMostly cloudy
ovcOvercast
wind_fewA few clouds and windy
wind_sctPartly cloudy and windy
wind_bknMostly cloudy and windy
wind_ovcOvercast and windy
Rain
Icon CodeDescription
rainRain
rain_showers_hiRain showers (high cloud cover)
rain_showersRain showers (low cloud cover)
Thunderstorm
Icon CodeDescription
tsraThunderstorm (high cloud cover)
tsra_sctThunderstorm (medium cloud cover)
tsra_hiThunderstorm (low cloud cover)
tornadoTornado
hurricaneHurricane conditions
tropical_stormTropical storm conditions
Snow
Icon CodeDescription
snowSnow
rain_snowRain/snow
rain_sleetRain/sleet
snow_sleetSnow/sleet
fzraFreezing rain
rain_fzraRain/freezing rain
snow_fzraFreezing rain/snow
sleetSleet
blizzardBlizzard
coldCold
Fog/Haze/Smoke
Icon CodeDescription
fogFog/mist
hazeHaze
smokeSmoke
dustDust

Exemples

Full exmaple
Current Temp
Display Icon
Forecast

Changelog

[2.0.4] - 2020-11-04
Added

weather.current.uv - UV index from the EPA's Envirofacts Data Service API
weather.current.air_quality - Air quality information from EPA's airnow.gov

[2.0.0] - 2020-09-19
Changed

Shifted all data to NWS

Removed

OpenWeatherMap and Weatherbit data

Removed map and moved it to version 3

Depricated

current.uv [Hopefully will return in v3] cuurrent.air_quality [Hopefully will return in v3] forecast[i].wind_cdir_full
forecast[i].dewpt
forecast[i].vis
forecast[i].pop
forecast[i].precip
forecast[i].snow
forecast[i].pres

[1.6.0] - 2020-03-18
Changed

Time is now localized to the time at the zip code

[1.5.0] - 2020-03-18
Added

Updated Readme

Changed

Fixed Mixed content (http/https)

[1.4.0] - 2020-03-15
Added

Working map using OpenLayers

[1.3.0] - 2020-02-14
Removed

Expired dependancies

TODO

v2
v3
  • Add other types of search
  • Add map back in
  • get mothods written by students and add those dynamically to the vue methods

Contributors

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT License

Keywords

FAQs

Package last updated on 10 Nov 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc