Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
mini-owm
Advanced tools
Readme
A wrapper around Open Weather Map's One Call Api.
Configure it via initialization, chaining, individual calls, or mix and match.
mini-owm also simplifies the Open Weather Api by:
1h
property from rain
and snow
directly to those properties (who starts a json property with a number?)
current.rain['1h']
the rain value is at current.rain
rain
or snow
to 0
instead of omitting (0 is better than undefined)npm install mini-owm
To make a call to OpenWeatherMap you must provide an api key, latitude, and longitude. All other configuration is optional.
import MiniOwm, { Units } from 'mini-owm';
// constructor parameters are all optional
const api = new MiniOwm(
'<your api key here>', // owm api key
33.441792, // latitude
-94.037689, // longitude
'hourly,minutely' // exclude
Units.Imperial, // units (default is 'metric' for mini-owm)
'de' // language
);
api.get().then(res => {
console.log(res);
});
import MiniOwm from 'mini-owm';
const api = new MiniOwm();
api
.apiKey('<your api key here>')
.latitude(33.441792)
.longitude(-94.037689)
.exclude('hourly,minutely')
.standard() // set units to standard (Kelvin)
.imperial() // set units to imperial (Fahrenheit)
.metric() // set units to metric (Celcius) - this is default for mini-owm
.language('de')
.get()
.then(res => {
console.log(res);
});
import MiniOwm, { Units } from 'mini-owm';
// get attributes properties are all optional
new MiniOwm()
.get({
apiKey: '<your api key here>',
coords: {
latitude: 33.441792,
longitude: -94.037689,
},
exclude: 'hourly,minutely',
units: Units.Metric, // or 'metric'
language: 'de'
})
.then(res => {
console.log(res);
});
pnpm install
.env
with contents: API_KEY=<your api key here>
pnpm run start
See index.ejs.
Latest tested runtimes
FAQs
Mini ES wrapper for OpenWeatherMap api
The npm package mini-owm receives a total of 6 weekly downloads. As such, mini-owm popularity was classified as not popular.
We found that mini-owm 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.