{"id":22791091,"url":"https://github.com/soplakanets/node-forecastio","last_synced_at":"2025-04-16T03:34:39.757Z","repository":{"id":19362421,"uuid":"22602320","full_name":"soplakanets/node-forecastio","owner":"soplakanets","description":"A node.js client for Forecast.io API","archived":false,"fork":false,"pushed_at":"2018-06-12T11:50:25.000Z","size":20,"stargazers_count":31,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T04:42:15.745Z","etag":null,"topics":["darksky","darksky-api","forecast","forecast-api","forecastio","node","nodejs","weather","weather-api","weather-forecast"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/soplakanets.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-04T11:52:58.000Z","updated_at":"2025-01-29T02:40:56.000Z","dependencies_parsed_at":"2022-09-13T10:40:33.943Z","dependency_job_id":null,"html_url":"https://github.com/soplakanets/node-forecastio","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soplakanets%2Fnode-forecastio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soplakanets%2Fnode-forecastio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soplakanets%2Fnode-forecastio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soplakanets%2Fnode-forecastio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soplakanets","download_url":"https://codeload.github.com/soplakanets/node-forecastio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248752716,"owners_count":21156152,"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":["darksky","darksky-api","forecast","forecast-api","forecastio","node","nodejs","weather","weather-api","weather-forecast"],"created_at":"2024-12-12T02:32:29.835Z","updated_at":"2025-04-16T03:34:39.713Z","avatar_url":"https://github.com/soplakanets.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"forecastio\n==========\n\n[![Build Status](https://travis-ci.org/soplakanets/node-forecastio.svg?branch=master)](https://travis-ci.org/soplakanets/node-forecastio) [![Dependency Status](https://david-dm.org/soplakanets/node-forecastio.png)](https://david-dm.org/soplakanets/node-forecastio)\n![Badge](https://img.shields.io/badge/has%20nifty%20badges-yes-green.svg)\n\nA node.js client library for [Forecast.io API](https://developer.forecast.io).\n\nFor explanation and more detailed info about endpoints and response format see [Forecast.IO API documentation](https://developer.forecast.io/docs/v2)\n\n\n## Installation\n\n```\nnpm install forecastio\n```\n\n\n## Usage\nSay you need a [forecast](https://developer.forecast.io/docs/v2#forecast_call) for London, UK:\n\n```javascript\nvar ForecastIo = require('forecastio');\n\nvar forecastIo = new ForecastIo('\u003capiKey\u003e');\nforecastIo.forecast('51.506', '-0.127').then(function(data) {\n  console.log(JSON.stringify(data, null, 2));\n});\n```\n\n\n### \"Time Machine\" Requests\nForecast.io also supports [Time Machine requests](https://developer.forecast.io/docs/v2#time_call). Quoting official documentation you can make request for \"60 years in the past to 10 years in the future\" for \"many places\". Example:\n\n```javascript\n// What was the weather like in London on January 1st 2008?\nforecastIo.timeMachine('51.506', '-0.127', '2008-01-01T00:00:01Z').then(function(data) {\n  console.log(JSON.stringify(data, null, 2));\n});\n```\n\n### API Options\nBoth `#forecast()` and `#timeMachine()` methods support passing additional options.\n*Below are some examples, for all options consult [Options section of Forecast.IO API documentation](https://developer.forecast.io/docs/v2#options).*\n\n\nExample of requesting ad forecast in Si(metric) units with only 'daily' fields:\n\n```javascript\nvar options = {\n  units: 'si',\n  exclude: 'currently,hourly,flags'\n};\nforecastIo.forecast('49.844', '24.028', options).then(function(data) {\n  console.log(JSON.stringify(data, null, 2));\n});\n```\n\nAnother example, a \"Time Machine\" request in UK units and localized in Italian:\n\n```javascript\nvar options = {\n  units: 'uk',\n  lang:  'it'\n};\nforecastIo.timeMachine('49.844', '24.028', '2008-01-01T00:00:01Z', options).then(function(data) {\n  console.log(JSON.stringify(data, null, 2));\n});\n```\n\n### Request Timeout\nTo set timeout for requests pass a timeout option to constructor, example:\n\n```javascript\nvar forecastIo = new ForecastIo('\u003capiKey\u003e', {timeout: 30*1000});\n```\nAs a result all API request made with with this `forecastIo` instance will have a timeout of 30 seconds.\n\nTimeout option accepts time in milliseconds. If request will not finish in time - a callback will be fired with a timeout error.\n\n\n## TODO\n- Logging (for debugging at least)\n- Smarter API methods (accept `Date` object in `#timeMachine()` and convert it to string, for example)\n\n\n## Contributing\n* Fork the repo \u0026 commit changes\n* Make sure tests are not failing:\n\n  $ env FORECASTIO_API_KEY=`your_api_key` npm test\n\n* Create a pull request\n\n\n## Changelog\n\n#### 2.0.0\n- Dropped support for node \u003c 4.x\n- Fixed deprecation warnings for dependencies.\n\n#### 1.0.2\n- Fixed deprecation warnings.\n\n#### 1.0.0\n- Promises (For compatibility callbacks are still supported).\n\n#### 0.2.0\n- Added `timeout` option\n\n#### 0.1.2\n- More informative error messages.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoplakanets%2Fnode-forecastio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoplakanets%2Fnode-forecastio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoplakanets%2Fnode-forecastio/lists"}