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 🙏

© 2025 – Pkg Stats / Ryan Hefner

node-accuweather

v1.7.0

Published

An node wrapper for the AccuWeather API

Downloads

115

Readme

Accuweather Node

Installation Instructions

In your project directory, run:

npm install --save node-accuweather

Usage

Get your AccuWeather API Key at http://developer.accuweather.com/user/register.

var accuweather = require('node-accuweather')()(YOUR_API_KEY);

To Get Current Weather Conditions Based on Keyword Location (In Farenheit)

accuweather.getCurrentConditions("New York")
  .then(function(result) {
    console.log(result);
  });

/*
 { Summary: 'Cloudy',
   Temperature: 61,
   RealFeel: 57,
   Precipitation: { Value: 0, Unit: 'in', UnitType: 1 } }
*/

In Celsius

accuweather.getCurrentConditions("New York", {unit: "Celsius"})
  .then(function(result) {
    console.log(result);
  });

/*
{ Summary: 'Cloudy',
  Temperature: 16.1,
  RealFeel: 14,
  Precipitation: { Value: 0, Unit: 'mm', UnitType: 3 } }
*/

Note that this will return the "best match" result based on a keyword search, so "New York"s in other places besides the US won't return a result. See below to query based on specific key.

Listing Location Keys Based on Keyword Search

Using the same example, but with New York, NY's specific AccuWeather Location Key.

accuweather.queryLocations("New York").then(function(result) {
  console.log(result);  
});
/*
[ { Version: 1,
    Key: '349727',
    Type: 'City',
    Rank: 15,
    LocalizedName: 'New York',
    Country: { ID: 'US', LocalizedName: 'United States' },
    AdministrativeArea: { ID: 'NY', LocalizedName: 'New York' } },
  { Version: 1,
    Key: '2531279',
    Type: 'City',
    Rank: 85,
    LocalizedName: 'New York',
    Country: { ID: 'GB', LocalizedName: 'United Kingdom' },
    AdministrativeArea: { ID: 'TWR', LocalizedName: 'Tyne and Wear' } },
  { Version: 1,
    Key: '710949',
    Type: 'City',
    Rank: 85,
    LocalizedName: 'New York',
    Country: { ID: 'GB', LocalizedName: 'United Kingdom' },
    AdministrativeArea: { ID: 'LIN', LocalizedName: 'Lincolnshire' } },
  { Version: 1,
    Key: '338870',
    Type: 'City',
    Rank: 85,
    LocalizedName: 'New York Mills',
    Country: { ID: 'US', LocalizedName: 'United States' },
    AdministrativeArea: { ID: 'MN', LocalizedName: 'Minnesota' } },
  { Version: 1,
    Key: '2128074',
    Type: 'City',
    Rank: 85,
    LocalizedName: 'New York Mills',
    Country: { ID: 'US', LocalizedName: 'United States' },
    AdministrativeArea: { ID: 'NY', LocalizedName: 'New York' } },
  { Version: 1,
    Key: '2642589',
    Type: 'City',
    Rank: 285,
    LocalizedName: 'New York Precinct',
    Country: { ID: 'US', LocalizedName: 'United States' },
    AdministrativeArea: { ID: 'NE', LocalizedName: 'Nebraska' } },
  { Version: 1,
    Key: '2126946',
    Type: 'City',
    Rank: 285,
    LocalizedName: 'New York Township',
    Country: { ID: 'US', LocalizedName: 'United States' },
    AdministrativeArea: { ID: 'MO', LocalizedName: 'Missouri' } } ]
*/

To Get Current Weather Conditions Based on AccuWeather Specific Location Key

Once you have your location key, you can get the current conditions based on that.

// Using location key for New York, NY
accuweather.getCurrentConditions("349727") // can be type string or Number
  .then(function(result) {
    console.log(result);
  });

/*
 { Summary: 'Cloudy',
   Temperature: 61,
   RealFeel: 57,
   Precipitation: { Value: 0, Unit: 'in', UnitType: 1 } }
*/