node-clima
Version:
Simple wrapper for OpenWeatherMap API
22 lines (17 loc) • 446 B
text/typescript
// clima.ts
export interface IClima {
url: string;
}
/**
* Create a new Clima instances
* @class
* @param {String} apiKey - Contains your API KEY
*/
export class Clima implements IClima {
url: string = 'http://api.openweathermap.org/data/2.5/weather?';
apiKey: string;
constructor (apiKey: string) {
if (typeof apiKey !== 'string') throw new Error('invalid apiKey passed to constructor.');
this.apiKey = apiKey;
}
}