Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
forecast.io-bluebird
Advanced tools
Lightweight wrapper for Forecast.IO weather API that returns Bluebird promises.
Weekly downloads
Readme
Wrapper for the http://forecast.io / Dark Sky API: https://developer.forecast.io/docs/v2
Only dependency is Bluebird!
Here's how to use it:
Require forecast.io
var Forecast = require('forecast.io-bluebird');
Instantiate an instance of the wrapper. You'll need to specify your API key. You may also supply your own timeout
value, which defaults to 2000ms or 2 seconds if not provided.
var forecast = new Forecast({
key: process.env.FORECAST_API_KEY,
timeout: 2500
});
To fetch a forecast for the current time:
forecast.fetch(latitude, longitude)
.then(function(result) {
console.dir(result);
})
.catch(function(error) {
console.error(error);
});
To fetch a forecast for a specific time:
var time = new Date().setDate(32);
forecast.fetch(latitude, longitude, time)
.then(function(result) {
console.dir(result);
})
.catch(function(error) {
console.error(error);
});
To fetch a forecast for the current time with any of the "options" specified on the documentation page:
var options = {
extend: 'hourly',
units: 'auto'
};
forecast.fetch(latitude, longitude, options)
.then(function(result) {
console.dir(result);
})
.catch(function(error) {
console.error(error);
});
To fetch a forecast for a specific time with additional "options" from the documentation page:
var time = new Date().setDate(32);
var options = {
units: 'si',
exclude: 'hourly,minitely',
lang: 'x-pig-latin'
};
forecast.fetch(latitude, longitude, time, options)
.then(function(result) {
console.dir(result);
})
.catch(function(error) {
console.error(error);
});
That's it folks! Now go build something awesome!
FAQs
Lightweight wrapper for Forecast.IO weather API that returns Bluebird promises.
The npm package forecast.io-bluebird receives a total of 0 weekly downloads. As such, forecast.io-bluebird popularity was classified as not popular.
We found that forecast.io-bluebird 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
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.