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

  • 1.5.2
  • 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), OpenWeatherMap, and Weatherbit.

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. 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.

Usage

Prerequisite

Before you begin there are a few things you need.

First (API Keys)

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.

Second (Load JS)

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">
Third (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>
Fourth (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" />

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/js/forecast.min.js" defer></script>
<link rel="stylesheet" href="https://unpkg.com/@warnick/forecast-js/css/forecast.css">

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

Icons

The following icons are based on the codes and descriptions used by OpenWeatherMap.

IconCodeDescription
clear sky icon01nclear sky
few clouds icon02nfew clouds
scattered clouds icon03nscattered clouds
broken clouds icon04nbroken clouds
shower rain icon09nshower rain
rain icon10nrain
thunderstorm icon11nthunderstorm
snow icon13nsnow
mist icon50nmist

Exemples

Full exmaple

https://codesandbox.io/s/forecast-js-example-959xr

Display Icon

Forecast

Changelog

[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

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 16 Apr 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