Search⌘ K

Solution to Sub-task: Get Path Names

Understand how to create a JavaScript function that asynchronously fetches directory paths by returning a promise. Learn to use fs.readdir in the callback to resolve either an array of file paths or an empty array in case of errors.

We'll cover the following...

Get path names

In this step, take the path to the directory as an argument. Return a promise that uses an asynchronous function to read the directory. In that callback function, resolve the array of paths to the ...