Socket
Socket
Sign inDemoInstall

openuv

Package Overview
Dependencies
51
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    openuv

A Node.js client library for OpenUV UV Index API: www.openuv.io


Version published
Weekly downloads
6
Maintainers
1
Install size
3.71 MB
Created
Weekly downloads
 

Readme

Source

OpenUV - A Node.js client library for OpenUV UV Index API

A Node.js client library for OpenUV UV Index API.

For API Key, documentation and more detailed info about endpoints and response format see OpenUV UV Index API Documentation

Installation

npm install openuv

Basic Usage

To get a real-time UV Index for a particular location you'll need:

var openuv = require('openuv')('v1','YOUR_API_KEY');

openuv.uv({lat: 12.23, lng: 45.32}, (err, data) => {
  console.log(JSON.stringify(data, null, 2));
});

To get a UV Index forecast for a particular location call:

var openuv = require('openuv')('v1','YOUR_API_KEY');

openuv.forecast({lat: 12.23, lng: 45.32}, (err, data) => {
  console.log(JSON.stringify(data, null, 2));
});

To get protection time for a particular location call:

var openuv = require('openuv')('v1','YOUR_API_KEY');

openuv.protection({lat: 12.23, lng: 45.32, from: 3.5, to: 3.5}, (err, data) => {
  console.log(JSON.stringify(data, null, 2));
});

Parameters

The #uvindex(),#forecast() and #protection() methods support passing additional options. Below are some examples, for all options consult OpenUV API documentation.

Example of requesting UV Index Forecast for a specific altitude for tomorrow:

var openuv = require('openuv')('v1','YOUR_API_KEY');

var parameters = {
  lat: 12.23,
  lng: 45.32,
  alt: 4523,
  dt: moment().add('day',1).toISOString()
}

openuv.forecast(parameters, (err, data) => {
  console.log(JSON.stringify(data, null, 2));
});

Contributing

  • Fork the repo & commit changes

Changelog

0.1.1

-Initial release

Keywords

FAQs

Last updated on 12 Mar 2018

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc