Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
msn-weather
Advanced tools
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.
Install this package using NPM:
$ npm install msn-weather --save
import weather from "msn-weather";
const data = await weather.search({
location: "Munich, DE",
language: "EN",
degreeType: "C"
});
To use this library with CommonJS, use this approach:
const weather = require("msn-weather").default;
You will receive a JavaScript object looking like this:
{
current: {
date: "2021-06-09",
day: "Wednesday",
temperature: "23°C",
sky: {
code: "partly_sunny",
text: "Partly Sunny"
},
observation: {
time: "12:00:00",
point: "Munich, BY, Germany"
},
feelsLike: "22°C",
humidity: "58%",
wind: {
display: "7 km/h North",
speed: "7 km/h"
}
},
forecasts: [
{
date: "2021-06-09",
day: "Wednesday",
temperature: {
low: "14°C",
high: "24°C"
},
sky: {
code: "partly_sunny",
text: "Partly Sunny"
},
precip: "90%"
},
{
date: "2021-06-10",
day: "Thursday",
temperature: {
low: "13°C",
high: "22°C"
},
sky: {
code: "light_rain",
text: "Light Rain"
},
precip: "100%"
},
{
date: "2021-06-11",
day: "Friday",
temperature: {
low: "15°C",
high: "23°C"
},
sky: {
code: "light_rain",
text: "Light Rain"
},
precip: "100%"
},
{
date: "2021-06-12",
day: "Saturday",
temperature: {
low: "15°C",
high: "24°C"
},
sky: {
code: "light_rain",
text: "Light Rain"
},
precip: "100%"
}
]
}
msn-weather
APIweather.find(options)
Retrieves weather data for a given location. Returns a promise with weather data.
Parameter | Type | Optional | Default | Description |
---|---|---|---|---|
options | Options | ❌ | None | Options for the search. |
Options
Options for the search.
Parameter | Type | Optional | Default | Description |
---|---|---|---|---|
location | String | ❌ | None | Location for the weather data. |
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 ). |
This project is licensed under MIT.
© 2021 Wlad Gumenyuk
FAQs
A simple MSN Weather API wrapper with built-in TypeScript support.
The npm package msn-weather receives a total of 8 weekly downloads. As such, msn-weather popularity was classified as not popular.
We found that msn-weather demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.