Created a node js application that uses the weather-js npm package to pull the weather from a specific location provided by the user. Saves user data and location search and allows for reading the log file.
Implement the logic for the WeatherAdmin
component.
-
This component requires you to read and save information. Be sure to
require
the appropriate Node package. -
Create a
WeatherAdmin
constructor. This constructor should return an object with two methods. -
One of those methods is
newUserSearch
, which should accept a user'sname
andlocation
; search for the weather in their area; and save the user's information in a log of all searches users have made thus far. -
The other method is
getData
, which should log or return a list of all of the searches users have executed thus far. -
When you finish, return to the code for your CLI and incorporate your completed
WeatherAdmin
component.
Node js