{"_id":"@cicciosgamino/openweather-apis","_rev":"3-cd3c91e22d660fd89b81c2cfd3064aa9","name":"@cicciosgamino/openweather-apis","dist-tags":{"latest":"5.2.0"},"versions":{"5.0.0":{"name":"@cicciosgamino/openweather-apis","version":"5.0.0","description":"Simple APIs to use with OpenWeatherMap.org free servicies, request a APPID on http://openweathermap.org/appid and start!","main":"index.js","type":"module","repository":{"type":"git","url":"git+ssh://git@github.com/CICCIOSGAMINO/openweather-apis.git"},"keywords":["openweather","openweathermap","meteo","weather","weather-api","apis"],"author":{"name":"Marco Canali","email":"marco.canali@gmail.com","url":"https://github.com/CICCIOSGAMINO"},"license":"GPL-3.0","bugs":{"url":"https://github.com/CICCIOSGAMINO/openweather-apis/issues"},"homepage":"https://github.com/CICCIOSGAMINO/openweather-apis","scripts":{"test":"mocha"},"dependencies":{"node-fetch":"^2.6.1"},"devDependencies":{"chai":"^4.3.4","lit":"*","mocha":"^9.0.3"},"directories":{"example":"examples","test":"test"},"gitHead":"18fb21966f2f03eefa437de1a348a1959715feee","_id":"@cicciosgamino/openweather-apis@5.0.0","_nodeVersion":"16.4.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-QHkXtOCkwmTGxQcunvGPZ0CjtK6EbGD1LxVIIaklYB6h6xc34iWkRn1tunUKbiZ6lQOgY60ta12tk6SUjo0yEQ==","shasum":"40f1466f77e6b8a034f52b893db46ab29916d3c8","tarball":"https://registry.npmjs.org/@cicciosgamino/openweather-apis/-/openweather-apis-5.0.0.tgz","fileCount":12,"unpackedSize":73868,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJk/sCRA9TVsSAnZWagAAF2IQAJRdrLYAGuVIyfzyA7MX\nYORSUFpcX7s4YFSL4jFv7t/Bi8Dm1cueABBkMB/yAinaAwzzfewqD63J3fGn\ns6gXv36Kmc3KovnFdQMQu365ly3jBW7hU5YqZQD0XIa+tddL5l4H7Old3rww\n0+0Kstvp5HbJUZEx0+YqAayahrSctiTojUjdgKwjKYT5gqixVYrLvawnZV6G\nNyfH+BbvRFmvMvEdMaHe8k3tQPFOG39w59WGDeq1bJrO90MWOb/8CF0SzKmw\nHiEUFRsoY5NVG++TEWA7u7kVbaihMQ0zeXs5aIYhRHdqmbAUDZ3EtxmDWoFZ\n9jVJGVQBsaX0axYDbatjw81rmoUl22GezqOBnpjvSV91NVJ6h36EmRd9THUd\nrca2lP+C156tgfXi/Vf7OWebrSawbcY6lj1nP8+sYq/z4i+wfSlY/u6yo4si\nCs+iPAOon0YjasmdoJVexFHUG+CvFs/8qjVkpX28tCvsLuVhVE05o4GXPYRt\nDKyWr1G90GVB1O5K7d4kEzmhwem9fow1lcichgEntY6JmSDQgMWJZjCDMHcZ\n7WzE0SuX+IdQA6JGkDzMBA1Tssn06AfkP9KyFOwDWUMUynhp6INvwpBzwl9n\n6msBX6OQ94qVTmpaI8lXQLpMA28K9mNmqHQCIaUFysuv4OrllEyVUBkLqutR\n/hHw\r\n=2jdN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDECzxV+I7QoskfBGrNB+XroOSXQLYfb9UtsVoXV2X3VwIgbD3naBdhFvWetCSLT8usUEIXe4B1UgQi0f1v0P4upko="}]},"_npmUser":{"name":"cicciosgamino","email":"marco.canali@gmail.com"},"maintainers":[{"name":"cicciosgamino","email":"marco.canali@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openweather-apis_5.0.0_1629900780784_0.6554482448442089"},"_hasShrinkwrap":false},"5.0.1":{"name":"@cicciosgamino/openweather-apis","version":"5.0.1","description":"Simple APIs to use with OpenWeatherMap.org free servicies, request a APPID on http://openweathermap.org/appid and start!","main":"index.js","type":"module","repository":{"type":"git","url":"git+ssh://git@github.com/CICCIOSGAMINO/openweather-apis.git"},"keywords":["openweather","openweathermap","meteo","weather","weather-api","apis"],"author":{"name":"Marco Canali","email":"marco.canali@gmail.com","url":"https://github.com/CICCIOSGAMINO"},"license":"GPL-3.0","bugs":{"url":"https://github.com/CICCIOSGAMINO/openweather-apis/issues"},"homepage":"https://github.com/CICCIOSGAMINO/openweather-apis","scripts":{"test":"mocha"},"dependencies":{"node-fetch":"^2.6.1"},"devDependencies":{"chai":"^4.3.4","lit":"*","mocha":"^9.0.3"},"directories":{"example":"examples","test":"test"},"gitHead":"9dbbcd00ab5924c237aa75ff66b5af7612bc7390","_id":"@cicciosgamino/openweather-apis@5.0.1","_nodeVersion":"16.4.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-wHzGuQzphNoEKpzThD/KXaFDYBW2QluMFuaHLhAhuAddFUFZTJjvyAqfK6QE2I+7gFrl9BR1tz31UBHxOahViw==","shasum":"8b8474d7d6f1b78c0f5e05232c3ada0589027ab2","tarball":"https://registry.npmjs.org/@cicciosgamino/openweather-apis/-/openweather-apis-5.0.1.tgz","fileCount":12,"unpackedSize":73612,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJlFNCRA9TVsSAnZWagAABSYP/2Nr8nrONRzRPKWxUoEp\nghJNzlbvwylivfNqMtRt3I8tLfl3NUnqUvpaw87y9VjSRFWfkshlxiIgTo1I\nqh65YfCJgMhE0tQsP/najCoWsjoQw44TKnaTwE71I3uXdGf8IyPIZdpD9Y2l\n7a0Y+DX/UMw/ryEaU0ZK3x/Wc3uJGtQzlsdzEoa5G4g5VD5hsIjEdzk5KxOe\nBN/K7exMlY/N96q+/BTnTy3tdnRTuy17ViQuRPHDVZ1mnM6WrLLkHnqWul4n\nAFLufRPJghMoBZmTrcn+b9VAAfdQh6upkdJYMlV82ieqSsA2ZLam0HwK4ik/\n9qHJJYBrFZXA8UpfXuk2YXJiTbibqG6H+oGJD/JZF/hqUxgoqAGCoWW3NbUo\n7Yl/xh4NlAoGHXFas+Q5c6+Bj5inzOvoZ9jilEHqcZTo6434ipMXWN2O0iYG\nc6ZLr1ThcFDjsTBHGiq8eeEE8q2jO46RSwFUy1Qz7iXRKAdjsxHlWnXGU1+f\nBIB3OHzSY6jN75016gCqOW8Zf9pmZItWxByBgqnMwMo8vRNECXM7OaTEsgsL\nUYQJEJbJg4rIsjpqyUqkxB0Oywvcv5gxDW84TJPt39zlsqX0OIGJoEdxcwHY\n7ETklUay4wCmBN1OpI9dsI/FlmzOgH/Tpeg88tl0TdhB0K0BdP8DEUowuZnv\n8zQf\r\n=PrIq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFPE2F6KiBkvBHLq57ex9468BvgEST5iQNHsx1TnvCheAiBsPmDiennAUBbSnu+oBpcDNHvn78by3qkxdls2lraP4w=="}]},"_npmUser":{"name":"cicciosgamino","email":"marco.canali@gmail.com"},"maintainers":[{"name":"cicciosgamino","email":"marco.canali@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openweather-apis_5.0.1_1629901133306_0.6486571112476884"},"_hasShrinkwrap":false},"5.2.0":{"name":"@cicciosgamino/openweather-apis","version":"5.2.0","description":"Simple APIs to use with OpenWeatherMap.org free servicies, request a APPID on http://openweathermap.org/appid and start!","main":"index.js","type":"module","repository":{"type":"git","url":"git+ssh://git@github.com/CICCIOSGAMINO/openweather-apis.git"},"keywords":["openweather","openweathermap","meteo","weather","weather-api","apis"],"author":{"name":"Marco Canali","email":"marco.canali@gmail.com","url":"https://github.com/CICCIOSGAMINO"},"license":"GPL-3.0","bugs":{"url":"https://github.com/CICCIOSGAMINO/openweather-apis/issues"},"homepage":"https://github.com/CICCIOSGAMINO/openweather-apis","scripts":{"test":"mocha"},"dependencies":{"node-fetch":"^3.2.0"},"devDependencies":{"chai":"^4.3.4","lit":"*","mocha":"^9.2.0"},"directories":{"example":"examples","test":"test"},"gitHead":"582b9059c1903805d56d79b82c58261a26519a49","_id":"@cicciosgamino/openweather-apis@5.2.0","_nodeVersion":"17.0.1","_npmVersion":"8.3.0","dist":{"integrity":"sha512-JmNx/tOixy3t4vYtK4Q8unxIABjO84Q5ehzTn9Zng+1pzBnQvPkgWkeCNByc0MPz/LXUQiZVp1y0ijGoAvGpzQ==","shasum":"edcfb079242691237b21cb37908cc5411bcba6d9","tarball":"https://registry.npmjs.org/@cicciosgamino/openweather-apis/-/openweather-apis-5.2.0.tgz","fileCount":12,"unpackedSize":73014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7shRCRA9TVsSAnZWagAAaT0QAIOZm1rFIr9hTqg2y4Fr\nZGIUfo1CAmLcrjBA4A2UphBEF+uF+oTTEdqz8IHK7kbsTZGa/RWJQnzrrNnb\nG8uGJ2mr/sZ3TI4hcyeyOeb/3uM/pd6G/rAtna88KZ/OZU3h85W8uqkJJ6nH\nqlXTwGTKDQ0ayrH0qo92rFo0U7exUdTFTTlAAoapBc66tBQ0T/j74U5XnDQ5\nYe/uxJPaScVT3ZzYa8V9LZU3JFTHJGXy26vnEXI48Cb+mboOHeFbmaYY4AVO\nes3BFG8qzlkTpL0198lZei8KVrSS9WY47dlYBpl+eQaRdo2PQJkDML9qhLVW\nSLf9EgAG1iXnmDZsGjEDKbq8tYisqADi4tPLa7WwTIPjhxtNHHZIxCiEN9c9\ndtyq1sjePheBzZgjS1d3xgstmPuontin+Dhx93WagnkEuapnrDfvAVKN8pJH\nBIah3QA2vY8UCJ/VKWG5yTnYXPbCXXJKeVMd8IwR0ddwVq57w/+UIVxG+rdT\ntCSPooMlONPkg7RvW0KuczFrXwSUdjUg2OPcLtpQSMCN+dSNgvrYTzRnkV9K\nXxt97HgyEyq9s3TyeO4fcayOqvV734PnjFNjjHdh8hJi3fE4Y9PMN9LpnrGQ\n50HTBr1yZLQVfkOwHMz9xxFFyNt0v0mKfqYNxJBKBWCaMOOjkPC+vzIrbtTG\nRUhf\r\n=bRvS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDSgMTTiLxE5IqjtYXPFnXlXIK9GRibt8z+GHWW6P2khAIgB2RB/SUgSJbzNvRHxPvLpQ1DVpg4DnFiPn74y8+7iXk="}]},"_npmUser":{"name":"cicciosgamino","email":"marco.canali@gmail.com"},"maintainers":[{"name":"cicciosgamino","email":"marco.canali@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openweather-apis_5.2.0_1643038801442_0.4941358639571971"},"_hasShrinkwrap":false}},"time":{"created":"2021-08-25T14:13:00.702Z","5.0.0":"2021-08-25T14:13:00.929Z","modified":"2022-04-04T22:58:24.360Z","5.0.1":"2021-08-25T14:18:53.472Z","5.2.0":"2022-01-24T15:40:01.681Z"},"maintainers":[{"name":"cicciosgamino","email":"marco.canali@gmail.com"}],"description":"Simple APIs to use with OpenWeatherMap.org free servicies, request a APPID on http://openweathermap.org/appid and start!","homepage":"https://github.com/CICCIOSGAMINO/openweather-apis","keywords":["openweather","openweathermap","meteo","weather","weather-api","apis"],"repository":{"type":"git","url":"git+ssh://git@github.com/CICCIOSGAMINO/openweather-apis.git"},"author":{"name":"Marco Canali","email":"marco.canali@gmail.com","url":"https://github.com/CICCIOSGAMINO"},"bugs":{"url":"https://github.com/CICCIOSGAMINO/openweather-apis/issues"},"license":"GPL-3.0","readme":"![GitHub issues](https://img.shields.io/github/issues/CICCIOSGAMINO/openweather-apis)\n[![npm version](https://badgen.net/npm/v/@cicciosgamino/openweather-apis)](https://www.npmjs.com/package/@cicciosgamino/openweather-apis)\n[![Build Status](https://travis-ci.org/CICCIOSGAMINO/openweather-apis.svg?branch=master)](https://travis-ci.org/CICCIOSGAMINO/openweather-apis)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/cicciosgamino/openweather-apis)\n\n# 🌞 🌨️ ❄️ @cicciosgamino/openweather-apis\nJavascript module wrapped around the OpenWeatherMap.org APIs for free servicies (getForecast4Days() works only with pro services). First step to use the module is get OpenWeatherMap.org API key, request a APPID (API Key) on http://openweathermap.org/appid and start to get the weather data!\n\nFollow the official site for more info about [OpenWeather](https://openweathermap.org/guide), and here if you want more info about the [APIs](https://openweathermap.org/current).\n\n<p align=\"center\">\n  <a href=\"#installation\">installation</a> •\n  <a href=\"#nodejs\">nodejs</a> •\n\t<a href=\"#web\">web</a> •\n  <a href=\"#errors\">Errors</a> •\n  <a href=\"#test\">Test</a> •\n  <a href=\"#todo\">TODO</a> •\n</p>\n\n⚠️ Notice\n\n- Only JSON format is handled (NOT XML)\n- Only HTTPS requests (NOT HTTP)\n\n## Installation\nLike all node packages, install and mange operation are done by npm (use the -s if you want save\nthe package in the package.json file):\n\n```bash\nnpm install @cicciosgamino/openweather-apis\n\n# install and save dependency in package.json\nnpm install @cicciosgamino/openweather-apis --save\n\n# global installation\nnpm install -g @cicciosgamino/openweather-apis\n```\n\n## Node.js\nInstall the package with npm, import the class you need:\n```javascript\nimport { AsyncWeather } from '@cicciosgamino/openweather-apis'\nconst weatherInstance = await new AsyncWeather()\n// retrieve the Api Key from OS env\nconst apiKey = process.env['OPENWEATHER_API_KEY'] || ''\n// or copy the Api Key into\nconst apiKey = 'sdgfd5g5f46...your_api_key_here'\n\n// You can use lang parameter to get the output in your language.\n// The contents of the description field will be translated.\nweather.setLang('it')\n// weather.getLang() '' get the language\n// af Afrikaans - al Albanian - ar Arabic - az Azerbaijani\n// bg Bulgarian\n// ca Catalan - cz Czech\n// da Danish - de German\n// el Greek - en English - eu Basque\n// fa Persian (Farsi) - fi Finnish - fr French\n// gl Galician\n// he Hebrew - hi Hindi - hr Croatian - hu Hungarian\n// id Indonesian - it Italian\n// ja Japanese\n// kr Korean\n// la Latvian - lt Lithuanian\n// mk Macedonian\n// no Norwegian - nl Dutch\n// pl Polish - pt Portuguese - pt_br Português Brasil\n// ro Romanian - ru Russian\n// sv, se Swedish - sk Slovak - sl Slovenian - sp, es Spanish - sr Serbian\n// th Thai - tr Turkish\n// ua, uk Ukrainian\n// vi Vietnamese\n// zh_cn Chinese Simplified - zh_tw Chinese Traditional - zu Zulu\n\n// set the location, only one is used for the request if multiple locations set\n// coordinates > zip + state Code > cityId > city\n\n// or set the coordinates (latitude,longitude)\nweather.setCoordinates(50.0467656, 20.0048731)\n// weather.getCoordinates() \t{ latitude: '', longitude: '' }\n\n// or set zip code and a valid country code\nweather.setZipCodeAndCountryCode(24024, 'IT')\n// weather.getZipCodeAndCountryCode()\t\t{ zipCode: '', countryCode: '' }\n// iso 3166 country code >>\n// 'AD', 'AE', 'AF', 'AG', 'AI','AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ',\n// 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS','BT', 'BV', 'BW', 'BY', 'BZ',\n// 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ',\n// 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR',\n// 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU',\n// 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP',\n// 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY',\n// 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ',\n// 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ','OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY',\n// 'QA', 'RE', 'RO', 'RS', 'RU', 'RW',\n// 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ',\n// 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ',\n// 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'YE', 'YT',\n// 'ZA', 'ZM', 'ZW'\n\n// or set city by ID, check the IDs in the file city.list.json.gz\n// http://bulk.openweathermap.org/sample/\nweather.setCityId(4367872)\n// weather.getCityId()\t'' get the city ID\n\n// or set city by name\nweather.setCity('Bergamo')\n// weather.getCity()\t'' get the city name\n\n// set the units you need 'metric'  'internal'  'imperial'\nweather.setUnits('metric')\n// weather.getUnits() \t'' get the units\n\n// check http://openweathermap.org/appid#get for get the APPID\nweather.setApiKey(apiKey)\n// weather.getApiKey() \t'' get the ApiKey\n```\n\nNow with the minimal set in place you can request the weather data! The module version after v5.0.0 included use Promise or Async/Await asynchronous coding style.\n```javascript\n// request the actual temperature [°C] of the location\nweather.getTemperature()\n  .then(result => console.log(`${typeof result} ${result}`))\t// number 23.48\n  .catch(error => console.log(error))\n\n// request the actual pressure [hPa] of the location\nweather.getPressure()\n  .then(result => console.log(`${typeof result} ${result}`))  // number 1023\n  .catch(error => console.log(error))\n\n// request the actual humidity [%] of the location\nweather.getHumidity()\n\t.then(result => console.log(`${typeof result} ${result}`))  // number 51\n  .catch(error => console.log(error))\n\n// request the weather title\nweather.getTitle()\n  .then(result => console.log(`${typeof result} ${result}`))\t// string clear\n  .catch(error => console.log(error))\n\n// request the weather description\nweather.getDescription()\n  .then(result => console.log(`${typeof result} ${result}`))\t// string cielo sereno\n  .catch(err => console.log(err))\n\n// request the main weather data in JSON format\nweather.getSmartJSON()\n  .then(result => console.log(result))\n  .catch(err => console.log(err))\n// {\n//  temp: 23.45,\n//  humidity: 51,\n//  pressure: 1023,\n//  description: 'cielo sereno',\n//  weathercode: 800,\n//  rain: undefined\n// }\n\n// request all weather data\nweather.getAllWeather()\n\t.then(result => console.log(result))\n\t.catch(error => console.log(error))\n// {\n//  coord: { lon: 6.9737, lat: 45.7896 },\n//  weather: [\n//    {\n//      id: 800,\n//      main: 'Clear',\n//      description: 'cielo sereno',\n//      icon: '01d'\n//    }\n//  ],\n//  base: 'stations',\n//  main: {\n//    temp: 23.45,\n//    feels_like: 23.18,\n//    temp_min: 19.86,\n//    temp_max: 26.55,\n//    pressure: 1023,\n//    humidity: 51,\n//    sea_level: 1023,\n//    grnd_level: 885\n//  },\n//  visibility: 10000,\n//  wind: { speed: 1.38, deg: 241, gust: 2.22 },\n//  clouds: { all: 1 },\n//  dt: 1628760600,\n//  sys: {\n//    type: 2,\n//    id: 2003229,\n//    country: 'IT',\n//    sunrise: 1628742511,\n//    sunset: 1628793955\n//  },\n//  timezone: 7200,\n//  id: 3177872,\n//  name: 'Courmayeur',\n//  cod: 200\n// }\n\n// (PRO APIs) request the forecast for the location where\n// cnt is the hours of forecast from 1 to 96 (hours)\ngetForecast4Days (cnt)\n\t.then(result => console.log(result))\n\t.catch(error => console.log(error))\n\n'Error: Response Code 401 >> Invalid API key. Please see http://openweathermap.org/faq#error401 for more info.'\n\n// Use Async / Await\ntry {\n\t// request the actual pressure of the location\n  const r = await weather.getPressure()\n  console.log(`${typeof r} ${r}`)\n\n\t// ....\n} catch(err) {\n  console.log(err)\n}\n```\n\n## Web\nThe module can be used in the browser too. In the example you can see an easy example of Web Component build with Lit that use the module to retrieve the weather data:\n```javascript\nimport { LitElement, html } from 'lit'\nimport { resolvePromise } from '../directive/resolve-promise'\nimport { AsyncWeather } from '../index.js'\n\nclass OpenweatherApis extends LitElement {\n\tstatic get properties () {\n\t\treturn {\n\t\t\ttemp: Number,\n\t\t\tapiKey: String,\n\t\t\tweatherAPI: Object\n\t\t}\n\t}\n\n\tconstructor () {\n\t\tsuper()\n\t\tnew AsyncWeather().then(w => {\n\t\t\tthis.weatherAPI = w\n\t\t\t// set the apiKey\n\t\t\tthis.weatherAPI.setApiKey(this.apiKey)\n\t\t})\n\t}\n\n\trender () {\n\t\treturn html`\n      Bergamo >> \n      ${this.weatherAPI\n\t\t? resolvePromise(this.weatherAPI.getTemperature())\n\t\t: '...'}°C - \n\n      ${this.weatherAPI\n\t\t? resolvePromise(this.weatherAPI.getDescription())\n\t\t: '...'}\n    `\n\t}\n}\n\ncustomElements.define('openweather-apis', OpenweatherApis)\n```\n\n\nComming Soon the WebComponent **openweather-apis-element** build wih Lit.\n\n\n## Errors\n\n**Commons Errors**\nError: Response Code 401 >> Invalid API key. Please see http://openweathermap.org/faq#error401 for more info.\n\n## Test\nThe package is tested with mocha and chai. You can find the tests in the /test folder. If you need more tests on module open an issue on the github repo (THANKS).\n\n## TODO 🔧\n- [ ] Implement Cities within a rectangle zone function\n- [ ] Implement Cities in circle function\n\n## 🧑‍💻 Author\n\n| [![@cicciosgamino](https://raw.githubusercontent.com/CICCIOSGAMINO/cicciosgamino.github.io/master/images/justme%40412x412_round.png)](https://www.linkedin.com/in/marco-canali-859b6a52/) \t|\n|:------------------------------------------------------------------------------------------:\t|\n|                                    **@cicciosgamino**                                      \t|\n\n\n## Support\nReach out to me at one of the following places:\n\n- [Web](https://cicciosgamino.web.app/)\n- [Github](https://github.com/CICCIOSGAMINO)\n- [Twitter](https://twitter.com/cicciosgamino)\n\n## Donate\n\nDonate help and contibutions no money!\n\n## License\n[GNU General Public License v3.0](https://github.com/CICCIOSGAMINO/init/blob/master/LICENSE)\n\nMade 🧑‍💻 by [@cicciosgamino](https://cicciosgamino.web.app)\n","readmeFilename":"README.md"}