![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
wunderground
Advanced tools
A simple wrapper around the Wunderground API for Node.
Installation is quick and easy via NPM:
npm install wunderground
You will also need a valid Wunderground API key.
Becuase spending more than a few minutes getting this API up-and-running is better spent making your app awesome.
There are a few other modules out there that integrate the Wunderground API but I wasn't quite satisifed with them.
The module is designed to be simple and easy to use and follows Wunderground's API verbiage almost exclusively. Please see the Wunderground documentation for a list of all available options.
var wunderground = require('node-wunderground')('my-api-key');
var query = {
city : 'San Francisco',
state : 'CA' // two-letter state code
};
// Print San Francisco's high and low temperatures for the next 10 days
wunderground.forecast10day(query, function(err, forecasts) {
if(err) {
// uh-oh!
} else {
var forecasts = res.forecast.simpleforecast.forecastday;
for(var i = 0; i < forecasts.length; i++) {
var f = forecasts[i];
console.log([f.date.month, f.date.day, f.date.year].join('/') + ' - High: '+ f.high.fahrenheit +', Low: '+ f.low.fahrenheit);
}
}});
// OR:
wunderground.conditions(query, function(err, conditions) {
// current conditions
if(!err) {
console.log('In Sanfrancisco, CA, it currently feels like '+ conditions.current_observation.temp_f);
}
});
The module accepts a variety of parameters in the query object (formal paramater names included in parenthesis if different):
NOTE: Latitude and longitude BOTH required. Providing only one is illegal.
You can provide any number of parameters but there is a precedence and established patterns:
You can also acess the wunderground.execute
method directly--the main advantage of this is you can specify multiple data sources to receive in a single request.
For example:
var query = {
zip : '20854'
};
var actions = ['forecast', 'forecast10day', 'conditions'];
wunderground.execute(actions, query, function(err, result) {
// Result has the current forecast, the 10 day forecast, and the current conditions for the US zip code 20854.
});
The Wunderground API provides results in a large range of languages. You can specify the language for API requests on initlaization. Example:
var wunderground = require('node-wunderground')('my-api-key', 'FR');
All requests will be returned in French. All languages are specified with a two letter, capitalized string. See the official documentation for the full list.
All usage of the Wunderground API is subjet to the API's terms of service, which can be found at: http://www.wunderground.com/weather/api/d/terms.html
FAQs
a simple wrapper around the wunderground API
The npm package wunderground receives a total of 0 weekly downloads. As such, wunderground popularity was classified as not popular.
We found that wunderground 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.