2.1.3 • Published 2 years ago

msn-weather v2.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Table of contents

About

msn-weather is a powerful Node.js library that allows you to easily retrieve weather data for any location in the world. As the name suggests, this wrapper uses the MSN weather API behind the scenes.

  • Simple and easy-to-use API
  • Built-in TypeScript definitions
  • Only one dependency
  • Clear weather data format
  • Performant

Installation

Install this package using NPM:

npm install msn-weather --save

Usage

import weather from "msn-weather";

const data = await weather.search({
  location: "Munich, DE",
  language: "en",
  degreeType: "C"
});

Usage with CommonJS

To use this library with CommonJS, use this approach:

const weather = require("msn-weather").default;

Retrieved data format

You will receive a JavaScript object looking like this:

API documentation

weather.search(options)

Retrieves weather data for a given location. Returns a promise with weather data (see retrieved data format).

ParameterTypeOptionalDefaultDescription
optionsOptionsNoneOptions for the search.

Options

Options for the search. | Parameter | Type | Optional | Default | Description | |-|-|-|-|-| | location | String | ❌ | None | Location for the weather data. The location will be encoded automatically using encodeURIComponent. | | language | String | ✔ | en | Language in which weather text will be returned. The value must be a ISO 639.1:2002 language code. | | degreeType | String | ✔ | C | Degree type for temperature values. Either Celsius (C) or Fahrenheit (F). |

Resources

Acknowledgements

Contributors

A special thanks goes out to these contributors:

  • Khang (khang-nd) - Contributing a number of times

License

This project is licensed under MIT.

2.1.3

2 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago