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
Maintainers
Keywords
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
andnpm 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.