Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
here-weather
Advanced tools
A wrapper for HERE Weather API made for NodeJS
You will need a api key to access the weather data from HERE.com. You can create a free account HERE Developer
npm install here-weather
Get your APP ID and APP CODE from here.com ready.
const weather = require("here-weather");
// Replace with your app details.
weather.setAuth({ app_id:"YOUR_APP_ID", app_code:"YOUR_APP_CODE" });
//7 Day forcast for city chicago with freedom units
weather.location({ name:"chicago" })
weather.metric(false);
weather.forecastSimple()
.then(({ forecast }) => {
return forecast.map(day => {
return {
highTemp: day.highTemperature,
lowTemp: day.highTemperature,
weatherIcon: {
icon: day.iconLink,
name: day.iconName
}
}
})
})
//Required before any request is made.
weather.setAuth({ app_id: "YOUR_APP_ID", app_code: "YOUR_APP_CODE" })
//Required before any request is made.
//Use either location name,lat/long or zip.
weather.location({ name: "Austin,Texas" })
weather.location({ latitude:30.2672, longitude:97.7431 })
weather.location({ zipcode: 73301 })
//Use them freedom units!
weather.metric(false)
//Change the return data language
weather.language("english_us")
//Or Code
weather.language("en-US")
//Will return weather data from closest observation if true else will get many obervation weather data
weather.oneobservation(true)
//Date for which hourly forecasts are to be retrieved. The format is YYYY-MM-DD or YYYY-MM-DDThh:mm:ss
weather.hourlydate("2019-05-18")
//Will reset location,language,metric,oneobservation,hourlydate and auth info.
weather.resetSettings()
All forecast methods return a promise. Before requesting any data you MUST set auth and location.
//Request a simplified seven day weather forecast
const { feedCreation, forecastLocation, forecast } = await weather.forecastSimple()
//Request a full seven day weather forecast
const { feedCreation, forecastLocation, forecast } = await weather.forecastExtended()
//Request an hour-by-hour seven day weather forecast
const { feedCreation, forecastLocation, forecast } = weather.forecastHourly()
//Request current weather observations around a named location, latitude and longitude and or zip code.
const { feedCreation, observationLocations } = await weather.forecastObservation()
//Request information on when the sun and moon will rise and set
const { feedCreation, astronomyLocation, astronomy } = await weather.forecastAstronomy()
//Request severe weather alerts around a city
const { feedCreation, alertLocation, alerts } = await weather.alerts()
//You can get the full alert description type by using
weather.alertTypeDescription(ALERT_TYPE);
//Request severe national weather alerts around a city
//nwsAlerts will be undefined if no alerts are found.
const { feedCreation, nwsAlerts } = await weather.nwsAlerts()
//Get all weather settings
const { location, language, metric, onebsercation, hourlydate} = weather.getSettings;
//Get auth config
const { app_code, app_id } = weather.getAuth;
//Get here api weather url
const url = weather.apiUrl;
//Get accepted language codes array
const languageCodes = weather.acceptedLanguageCodes;
//Get accepted language names array
const languageNames = weather.acceptedLanguageNames;
//Get weather alert type descriptions array
const alertDescription = weather.alertTypeDescriptions;
FAQs
Simple api helper for HERE Weather api.
The npm package here-weather receives a total of 1 weekly downloads. As such, here-weather popularity was classified as not popular.
We found that here-weather 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.