Now what we want to do is pull the address out of argv, we already saw that it's there, we want to encode it and we want to inject it in our URL in app.js file, replacing the address:

This will essentially create that dynamic request we've been talking about. We'll be able to type in any address we want, whether it's an address or a zip code or a city state combination, and we'll be able to fetch the formatted address, the latitude, and the longitude.
In order to get started, the first thing I'll do is get the encoded address. Let's make a variable called encodedAddress in the app.js next to the argv variable, where we can store that result. We'll set this equal to the return value from the method we just explored in the Terminal, encodeURIComponent. This will take the plain text address and return the encoded result.
Now we do need to pass in the string, and we have that available on argv.address which is the alias:
.help()
.alias('help', 'h')
.argv;
var encodedAddress = encodeURIComponent(argv.address);
Now we have that encoded result all that's left to do is inject it inside of the URL string. In the app.js, currently we're using a regular string. We'll swap this out for a template string so I can inject a variable inside of it.
Now that we have a template string, we can highlight the static address which ends at philadelphia and goes up to the = sign, and remove it, and instead of typing in a static address we can inject the dynamic variable. Inside of my curly braces, encodedAddress, as shown here:
var encodedAddress = encodeURIComponent(argv.address);
request({
url: `https://maps.googleapis.com/maps/api/geocode/json?address=${encodedAddress}`,
With this in place we are now done. We get the address from the Terminal, we encode it, and we use that inside of a geocode call. So the formatted address, latitude, and longitude should match up. Inside the Terminal, we'll shut down node by using control + C twice and use clear to clear the Terminal output.
Then we can go ahead and run our app using node app.js, passing in either the a or address flag. In this case, we'll just use a. Then we can go ahead and type in an address, for example, 1614 south broad street philadelphia as shown here:
node app.js -a '1614 south broad street philadelphia'
In this case we'll find that it's actually taking a little longer than we would expect, about three or four seconds, but we do get the address back:

Here we have the formatted address with a proper zip code state and country, and we also have the latitude and longitude showing up. We'll try a few other examples. For example for a town in Pennsylvania called Chalfont, we can type in chalfont pa which is not a complete address, but the Google Geocode API will convert it into the closest thing, as shown here:

We can see that it's essentially the address of the town, Chalfont, PA 18914 is the zip, with the state USA. Next, we have the general latitude and longitude data for that town, and this will be fine for fetching weather data. The weather isn't exactly changing when you move a few blocks over.
Now that we have our data coming in dynamically, we are able to move on to the next section where we'll handle a lot of the errors that happen inside of callbacks. There are a lot of ways this request can go wrong, and we'll want to figure out how to recover from errors inside of our callback functions when we're doing asynchronous programming.