0.0.6 • Published 7 years ago
xyzweather v0.0.6
天气 API
该 API 对心知天气做了一层 Node 封装,主要包含三个免费接口:实时天气、逐日天气、生活指数。
使用方法
const UID = 'XXX'; // 测试用 用户ID,请更换成您自己的用户ID
const KEY = 'XXX'; // 测试用 key,请更换成您自己的 Key
const API = require('xyzweather');
const api = new API(UID, KEY);
// 实时天气
const now = await api.getWeatherNow(location);
//逐日天气
const daily = await api.getWeatherDaily(location, days);
//生活指数
const suggestion = await api.getWeatherSuggestion(location);