Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

yahoo-weather

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yahoo-weather

A simple yahoo weather API wrapper

  • 2.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-62.5%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status npm version

node-yahoo-weather

node-yahoo-weather is a dead simple isomorphic JavaScript weather module in 10 lines of code.

The code is written using ES2015 and simply transformed back using babel to the dist directory using a Grunt task.

I made this module cause I need it and I feel it may be used by someone, someday. Let's get started! :grin:

Installation

Clone the repo or install it from npm:

npm install yahoo-weather --save

Usage

Dead simple, as I said! Just one required param. Check it:

import weather from 'yahoo-weather'; // or require it

weather('tehran').then(info => {
  // Do what you want with `info`!
}).catch(err => {
  // Oops! Errors! :(
});

weather('tehran', 'f').then(info => { // second arg is the weather unit. you can pass 'c' or 'f'. defaults to 'c'.
  // Do what you want with `info`!
}).catch(err => {
  // Oops! Errors! :(
});

// or use it with awesome async & await
async () => {
  try {
    const info = await weather('tehran');
    // Do what you want with `info`!
  } catch (err) {
    // Oops! Errors! :(
  }
}();

Tests

Run the tests with following command:

npm test

Ideas?

Just fill an issue and describe it. I'll check it ASAP. :grin:

Contribution

You can fork the repository, improve or fix it and then send the pull requests back if you want to see them here. I really appreciate that. :heart:

Remember to lint your code before sending pull requests. Execute the linter script by running the following command and fix the errors if you get any.

npm run lint

Keywords

FAQs

Package last updated on 15 Nov 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc