npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

feathers-openweathermap

v1.0.1

Published

An OpenWeatherMap Service for feathers.js applications

Downloads

231

Readme

feathers-openweathermap

npm npm GitHub license

An OpenWeatherMap API service for Feathers 5 applications. Supports current weather, forecasts, one call, and air pollution data.

Supported APIs

Installation

pnpm add feathers-openweathermap

Get your appid

Follow the instructions at: https://openweathermap.org/appid

Setup

Each API endpoint has its own dedicated service. Register only the ones you need:

import {
  WeatherService,
  OneCallService,
  ForecastService,
  AirPollutionService,
} from 'feathers-openweathermap'

const options = { appid: 'YOUR_APP_ID' }

app.use('openweathermap/weather', new WeatherService(options))
app.use('openweathermap/onecall', new OneCallService(options))
app.use('openweathermap/forecast', new ForecastService(options))
app.use('openweathermap/air-pollution', new AirPollutionService(options))

Service options

  • appid (required) - your appid from openweathermap.org
  • v (optional, default: '3.0') - the API version
  • mode (optional, default: 'json') - the results format ('json', 'xml', 'html')
  • lang (optional, default: 'en') - the language of the result. info
  • units (optional, default: 'standard') - Units of measurement. 'standard', 'metric' and 'imperial' units are available.

Services

Each service exposes find(params) and create(data). They are functionally equivalent. create() is useful for taking advantage of the .on('created') service event.

WeatherService

// find with query
app.service('openweathermap/weather').find({
  query: { cityName: 'Munich', stateCode: 'DE' },
})

// or create with data
app.service('openweathermap/weather').create({ cityId: 2844588 })

OneCallService

app.service('openweathermap/onecall').find({
  query: { lat: 52.520008, lon: 13.404954 },
})

ForecastService

app.service('openweathermap/forecast').find({
  query: { cityName: 'Munich', stateCode: 'DE' },
})

HourlyForecastService / DailyForecastService / ClimaticForecastService

import { HourlyForecastService, DailyForecastService, ClimaticForecastService } from 'feathers-openweathermap'

app.use('openweathermap/forecast-hourly', new HourlyForecastService(options))
app.use('openweathermap/forecast-daily', new DailyForecastService(options))
app.use('openweathermap/forecast-climate', new ClimaticForecastService(options))

AirPollutionService

find() and create() return current air pollution. Additional methods forecast() and historical() are available:

// current
app.service('openweathermap/air-pollution').find({
  query: { lat: 52.520008, lon: 13.404954 },
})

// forecast
app.service('openweathermap/air-pollution').forecast({
  lat: 52.520008,
  lon: 13.404954,
})

// historical
app.service('openweathermap/air-pollution').historical({
  lat: 52.520008,
  lon: 13.404954,
  start: 1606223802,
  end: 1606482999,
})

Location query options

All weather/forecast endpoints support these location methods:

| Method | Parameters | |--------|-----------| | City name | cityName, stateCode?, countryCode? | | City ID | cityId | | Coordinates | lat, lon | | Zip code | zipCode, countryCode? |

OneCall and AirPollution only support coordinates (lat, lon).

Testing

pnpm test

Tests use mocked fetch responses and run without an API key.

License

Licensed under the MIT license.