{"id":21396418,"url":"https://github.com/baslr/node-openweathermap","last_synced_at":"2025-07-13T19:31:08.539Z","repository":{"id":62699009,"uuid":"10242080","full_name":"baslr/node-openweathermap","owner":"baslr","description":"A small abstraction layer for the openweathermap API","archived":false,"fork":false,"pushed_at":"2016-03-14T07:58:10.000Z","size":246,"stargazers_count":24,"open_issues_count":5,"forks_count":9,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-07-02T03:17:35.483Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/baslr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-23T11:17:21.000Z","updated_at":"2023-02-12T10:04:15.000Z","dependencies_parsed_at":"2022-11-04T17:16:18.691Z","dependency_job_id":null,"html_url":"https://github.com/baslr/node-openweathermap","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/baslr/node-openweathermap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baslr%2Fnode-openweathermap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baslr%2Fnode-openweathermap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baslr%2Fnode-openweathermap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baslr%2Fnode-openweathermap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baslr","download_url":"https://codeload.github.com/baslr/node-openweathermap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baslr%2Fnode-openweathermap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265194740,"owners_count":23725967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T14:26:59.561Z","updated_at":"2025-07-13T19:31:08.295Z","avatar_url":"https://github.com/baslr.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"node-openweathermap\n===================\n\nA small abstraction layer for the openweathermap API\n\n### install\n\n    $ npm install openweathermap\n\n### methods\n\n    # set defaults\n    defaults(cfg)\n\n    # return the weather right now\n    now(cfg, callback)\n\n    # get a 7 days every 3h forecast\n    forecast(cfg, callback)\n\n    # get up to 14 days daily forecast\n    # cfg\n    #  cnt:int(number of days for forecast)\n    daily(cfg, callback)\n    \n    # get history for a city\n    history(cfg, callback)\n    \n    # find\n    #  cnt, beginns from 0, cnt 0 returns 1 item, cnt 1 returns 2 items\n    find(cfg, callback)\n    \n### (defaults)\n\n    units: ('metric'|'imperial'|'internal')\n    lang:  ('en'|'ru'|'it'|'sp'|'ua'|'de'|'pt'|'ro'|'pl'|'fi'|'nl'|'fr'|'bg'|'se'|'zh_tw'|zh_cn')\n    mode:  'json' // for now only json support\n    q:     'City Name e.g. London,UK or Berlin,Germany'\n    cnt:   Number(forecast:number of days, find: 0..)\n    id:    Number(city id)\n    \n    # history\n    type:  ('tick'|'hour'|'day')\n    start: Number(unix timestamp)\n    end:   Number(unix timestamp)\n    cnt:   Number(list count)\n    \nattribute \\ function | defaults | now | daily | history | find | forecast\n--------------------:|:--------:|:---:|:-----:|:-------:|:----:|:--------:\nq                    |     x    |  x  |   x   |    -    | x    |  x\nid                   |     x    |  x  |   x   |    x    | -    |  x\ncnt                  |     x    |  -  |   x   |    x    | x    |  -\nstart                |     x    |  -  |   -   |    x    | -    |  -\nend                  |     x    |  -  |   -   |    x    | -    |  -\nunits                |     x    |  x  |   x   |    x    | x    |  x\n\n### opts\n\n    weather.ops({port:8080})\n\nsets the port to 8080 for all following requests. The opts method is chainable.\nGenerally you can set all http.get [Node.js options](http://nodejs.org/api/http.html#http_http_request_options_callback).\n\n### Examples\n\n    weather = require 'openweathermap'\n    \n    # set defaults\n    weather.defaults {units:'metric', lang:'de', mode:'json'}\n    \n    # id is Cologne, Germany\n    weather.now {id:2886242}, (err, json) -\u003e\n      console.dir json\n\n    # 2 days forecast\n    weather.daily {id:2886242, cnt:2}, (err, json) -\u003e\n      console.dir json\n      \n    # history for 3 hours\n    weather.history {type:'hour', id:2886242, cnt:3}, (err, json) -\u003e\n      console.dir json\n\n    # find 3 berlins\n    weather.find {q:'berlin', cnt:2}, (err, json) -\u003e\n      console.dir json\n    \n    # forecast for Okemos, MI\n    weather.forecast {id: 5004359}, (err, json) -\u003e\n      console.dir json\n\nmore infos about openweathermap.org at \u003chttp://openweathermap.org\u003e\n\n### changelog\n\n#### 1.0.0\n* added error handling: Use node.js style Error-First Callbacks #5 (many thanks to @sweetpi)\n* release v1.0.0\n* release npm v1.0.0\n\n#### 0.2.1\n* fixes issue #4 bug: Return invalid json\n\n#### 0.2.0\n* node-openweathermap is now browserifiable, #2 (many thanks to @MikkoH)\n* set http options via opts() eg. port ...\n\n#### 0.1.1\n* fixed #1\n* resonse now in flow mode\n* use \u003chttp://semver.org/\u003e\n\n#### 0.0.3\n* added city history\n\n#### 0.0.2\n* added find\n\n#### 0.0.1\n* inital release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaslr%2Fnode-openweathermap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaslr%2Fnode-openweathermap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaslr%2Fnode-openweathermap/lists"}