
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
A simple weather package that takes advantage of the darksky and mapbox api
npm install weyder
const weyder = require('weyder') // OR
const {geoCode,foreCast,setAccessToken,setWeatherDataSpan} = require('weyder');
geoCode
(location) => [ latitude,longitude ]foreCast
([ latitude,longitude ]) => weather InformationsetAccessToken
("mapbox" || "darksky", mapbox_token || darksky_token)setWeatherDataSpan
({"currently" || "minutely" || "daily": boolean
})setAccessToken
This function is used to set the access token of mapbox and darksky endpoints
Create a free darksky and mapbox account, copy your own access token and pass the api name and access token to setAccessToken
setAccessToken("darksky","your_DarkSky_AccessToken")
setAccessToken("mapbox","your_MapBox_AccessToken")
setWeatherDataSpan
Use this function and set appropriate time span to get the more information from the api.
Object properties currently, minutely, hourly, daily
, value <boolean>
setWeatherDataSpan({
'currently': true,
'minutely': false,
'daily': true
})
The above sets
currently = true
,minutely = false
,hourly = false
,daily = true
NOTE: To undestand what currently, hourly, daily
holds, visit https://darksky.net/dev/docs#data-point
currently
hourly
daily
const getWeatherData = async (location) =>{
const geocode = await geoCode(location)
const forecast = await foreCast(geocode)
console.log(forecast)
}
getWeatherData("Austin")
// Output
// {
// currently: [...],
// hourly: [...]
// daily: [...],
// }
geoCode('Austin')
.then(geocode => foreCast(geocode))
.then(forecast => {
console.log(forecast);
})
.catch(e=>{
console.log(e);
})
// Output
// {
// currently: [...],
// hourly: [...]
// daily: [...],
// }
geoCode("Austin",(err,geocode)=>{
if(err) return err
foreCast(geocode,(err,forecast)=>{
if(err) return err
console.log(forecast)
})
})
// Output
// {
// currently: [...],
// hourly: [...]
// daily: [...],
// }
const {geoCode,foreCast,setAccessToken,setWeatherDataSpan} = require('weyder');
setAccessToken("darksky","your_DarkSky_AccessToken")
setAccessToken("mapbox","your_MapBox_AccessToken")
setWeatherDataSpan({
'currently': true,
'minutely': false,
'daily': true
})
geoCode('Austin')
.then(geocode => foreCast(geocode))
.then(forecast => {
console.log(forecast);
})
.catch(e=>{
console.log(e);
})
// Output
// {
// currently: [...],
// hourly: [...]
// daily: [...],
// }
FAQs
A simple weather package that takes advantage of the darksky and mapbox api
The npm package weyder receives a total of 9 weekly downloads. As such, weyder popularity was classified as not popular.
We found that weyder 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.