1.0.5 • Published 5 years ago

weather-cli-martapura v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

Instalasi

npm i weather-cli-martapura

atau

npx weather-cli-martapura

Konfigurasi

weather config -k={your api key} -c={your city id} -u=Celsius

buka link berikut untuk mendapatkan api key, jika belum punya akun silahkan daftar terlebih dahulu

  1. api keys
  2. cari kota
  3. https://openweathermap.org/city/1636022 <---- city id

Perintah

weather [command] <options>
commanddescription
nowshow weather for now
forecastshow weather forecast
configshow weather forecast
forecastset API key, default city ID, default temperature units
versionshow package version
helpshow help menu for a command

weather now <options>
optionsdescription
--api-key, -kset the API Key for OpenWeatherMap services if you haven't set it in configure method.
--city, -cset the City ID in OpenWeatherMap if you want to query weather data in a city different from the default one.
--units, -uset the temperature units if you want to read temperature in a different unit.

weather forecast <options>
optionsdescription
--api-key, -kset the API Key for OpenWeatherMap services if you haven't set it in configure method.
--city, -cset the City ID in OpenWeatherMap if you want to query weather data in a city different from the default one.
--units, -uset the temperature units if you want to read temperature in a different unit.

weather config <options>
optionsdescription
--print, -pprint current configuration object
--api-key, -k*Required set the API Key for OpenWeatherMap services.*
--city, -c*Optional set the default City ID in OpenWeatherMap. Default: 4862034*
--units, -u*Optional set the default temperature units. Options: Kelvin (default), Celsius, Fahrenheit.*

Publikasi paket npm

  1. buat akun baru di https://www.npmjs.com/
  2. jalankan perintah npm adduser --registry=https://registry.npmjs.org/:_authToken=<token-from-npm>
  3. -npm publish . --access=public

PENTING: pastikan nama package belum terdaftar

untuk memperbaharui package silahkan ubah version pada file package.json kemudian jalankan perintah -npm publish . --access=public

Sumber

https://codeburst.io/build-a-command-line-interface-cli-application-with-node-js-59becec90e28

1.0.5

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago