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 🙏

© 2024 – Pkg Stats / Ryan Hefner

get-forecast

v1.0.4

Published

## Objective This is a programming task that will test your ability to use the Node JS environment to develop a front end library, in line with the work we do at 7TV.

Downloads

2

Readme

Front-end library

Objective

This is a programming task that will test your ability to use the Node JS environment to develop a front end library, in line with the work we do at 7TV.

The Task

Write a library with a single api called getForecast() which returns weather forecast parameters like precipitation, temperature, humidity etc. The API should make use of the publicly available weather API OpenWeatherMap.

The API takes no inputs and returns an JSON object. For example:

    {
        "temperature" : "18.2C",
        "precipitation" : "0.1",
        "humidity" : "93%"
    }

The library must take into consideration certain user preferences like: location of the user, forecast parameters like precipitation, wind speed, wind direction, temperature etc., forecast period in hours and units (metric/imperial) which are stored in a user preferences JSON file.

For example:

{
    "parameters" : ["precipitation", "temperature", "humidity"],
    "location" : "Munich",
    "units" : "metric",
    "period" : "2"
}

With the above user preferences the API should get the precipitation probability, temperature and humidity forecast for the city of Munich over the next 2 hours.

Technical requirements

The library you build should:

  • Be ES5 compliant and be able to run on all modern browsers.
  • Be consumable as a single prebuilt, minified file
  • The API should be asynchronous.
  • Have a simple HTML page that demonstrates the implementation of the library API
  • Assume the user preferences file is stored as a JSON file in the same path as the packaged library file (e.g. in the /dist folder)

Testing

  • You should provide unit tests using testing frameworks like Mocha. However, we do not expect full test coverage.

Constraints

  • Use Node.js version 8+
  • Do not introduce any system dependencies (databases, caches, search engines, docker, ..) to solve this task. This task is about your problem solving skills and not about creating a production ready system. It should not require more than npm install and npm run build to have a packaged library.
  • 72h after being added to the project, your pushing rights will be revoked and the latest commit of your implementation will be the basis for your evaluation.
  • We respect your time and encourage you to keep it simple: You are not expected to spend days on this - just proof that you know how to write great software in Node.js

Evaluation criteria

In general you can think of the evaluation being a thorough peer review of your code. You will be evaluated by a number of criteria, among others:

  • How well did you apply engineering best practices (general & node.js specific)?
  • Is the library working as intended?
  • How readable is your code?
  • Does the library solve the problem
    • correctly?
    • efficiently?
  • Is your code consistent in itself (styling, language constructs, ..)?
  • Appropriate use of 3rd party modules
  • Proper use of git
  • Making good assumptions and documenting them

@HERE

We can Just npm install and npm run build and open index.html We can use this library as npm install get-forecast too.