Socket
Socket
Sign inDemoInstall

cwb-weather-assistant

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cwb-weather-assistant

Simple CWB client to fetch weather assistant for JavaScript


Version published
Weekly downloads
6
increased by500%
Maintainers
1
Install size
556 kB
Created
Weekly downloads
 

Readme

Source

cwb-weather-assistant

NPM version Build Status Coverage Status

Simple CWB client to fetch weather assistant for JavaScript

Install

$ npm install --save cwb-weather-assistant

Browser

Add a <script> to your index.html:

<script src="/node_modules/cwb-weather-assistant/dist/cwb-weather-assistant.min.js"></script>

Node.js / Webpack

Import the module to your *.js file:

const CWBClient = require('cwb-weather-assistant')

Usage

const cwb = new CWBClient(API_KEY)

Fetch all weather assistants of locations

cwb.fetch()
  .then(res => {
    console.log(res)  // result of the request
  })
  .catch(err => {
    console.log(err)
  })

Fetch a weather assistant of the location

cwb.fetch({ location: LOCATION })
  .then(res => {
    console.log(res)  // result of the request
  })
  .catch(err => {
    console.log(err)
  })

Get available LOCATION list

cwb.locations()  // an array for list of locations
LocationName
TAIPEI_CITY台北市
NEW_TAIPEI_CITY新北市
KEELUNG_CITY基隆市
HUALIEN_COUNTY花蓮縣
YILAN_COUNTY宜蘭縣
KINMEN_COUNTY金門縣
PENGHU_COUNTY澎湖縣
TAINAN_CITY台南市
KAOHSIUNG_CITY高雄市
CHIAYI_COUNTY嘉義縣
CHIAYI_CITY嘉義市
MIAOLI_COUNTY苗栗縣
TAICHUNG_CITY台中市
TAOYUAN_CITY桃園市
HSINCHU_COUNTY新竹縣
HSINCHU_CITY新竹市
PINGTUNG_COUNTY屏東縣
NANTOU_COUNTY南投縣
TAITUNG_COUNTY台東縣
CHANGHUA_COUNTY彰化線
YUNLIN_COUNTY雲林縣
LIENCHIANG_COUNTY連江縣

Reference

交通部中央氣象局-開放資料平臺

License

MIT © Chun-Kai Wang

Keywords

FAQs

Last updated on 21 Jan 2017

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc