
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
openweathermap
Advanced tools
A small abstraction layer for the openweathermap API
$ npm install openweathermap
# set defaults
defaults(cfg)
# return the weather right now
now(cfg, callback)
# get a 7 days every 3h forecast
forecast(cfg, callback)
# get up to 14 days daily forecast
# cfg
# cnt:int(number of days for forecast)
daily(cfg, callback)
# get history for a city
history(cfg, callback)
# find
# cnt, beginns from 0, cnt 0 returns 1 item, cnt 1 returns 2 items
find(cfg, callback)
units: ('metric'|'imperial'|'internal')
lang: ('en'|'ru'|'it'|'sp'|'ua'|'de'|'pt'|'ro'|'pl'|'fi'|'nl'|'fr'|'bg'|'se'|'zh_tw'|zh_cn')
mode: 'json' // for now only json support
q: 'City Name e.g. London,UK or Berlin,Germany'
cnt: Number(forecast:number of days, find: 0..)
id: Number(city id)
# history
type: ('tick'|'hour'|'day')
start: Number(unix timestamp)
end: Number(unix timestamp)
cnt: Number(list count)
attribute \ function | defaults | now | daily | history | find | forecast |
---|---|---|---|---|---|---|
q | x | x | x | - | x | x |
id | x | x | x | x | - | x |
cnt | x | - | x | x | x | - |
start | x | - | - | x | - | - |
end | x | - | - | x | - | - |
units | x | x | x | x | x | x |
weather.ops({port:8080})
sets the port to 8080 for all following requests. The opts method is chainable. Generally you can set all http.get Node.js options.
weather = require 'openweathermap'
# set defaults
weather.defaults {units:'metric', lang:'de', mode:'json'}
# id is Cologne, Germany
weather.now {id:2886242}, (err, json) ->
console.dir json
# 2 days forecast
weather.daily {id:2886242, cnt:2}, (err, json) ->
console.dir json
# history for 3 hours
weather.history {type:'hour', id:2886242, cnt:3}, (err, json) ->
console.dir json
# find 3 berlins
weather.find {q:'berlin', cnt:2}, (err, json) ->
console.dir json
# forecast for Okemos, MI
weather.forecast {id: 5004359}, (err, json) ->
console.dir json
more infos about openweathermap.org at http://openweathermap.org
FAQs
A small abstraction layer for the openweathermap API
The npm package openweathermap receives a total of 16 weekly downloads. As such, openweathermap popularity was classified as not popular.
We found that openweathermap 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
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.