From the course: Building Your First CLI App in Node

Create the basic file structure

From the course: Building Your First CLI App in Node

Start my 1-month free trial

Create the basic file structure

- [Instructor] So far we have set up our main index.js page and installed a couple of Node.js modules to help us run some additional functionality in the app. You can see this in your file structure on the left hand sidebar in your Sublime text. Now we're going to create the rest of the file structure of our app, via the terminal. The first thing we're going to do is begin by creating a new lib folder, just using that make directory command again. In this folder, we're going to have files that contain most of the functionality of our app. Everything will be called and run by the index.js file, but the files where the functions are set up will be in the lib folder. You can think of it like the index.js file being the captain of starship and the files in the lib folder being the different departments on the ship: a sickbay, warp core engineering, security. The captain is in charge of the whole ship and its crew, but is not personally responsible for executing any of the tasks in any of those areas himself. Similarly, the index.js file calls all the functionality from different files in the lib folder to run the app. So we're just going to CD into our lib folder, change directory. And in here we're going to create four new files. The first one is going to be files. The next one is going to be GitHub credentials. We're also going to have an inquirer file. And finally we want a create a repo file. These four files are going to support the entirety of our app's functionality. And the next thing we're going to do after this is begin getting some code into these files. We'll begin with our files.js file, which will be developed into our utility package. If we just do an LS right now, you can see that all four of our files are in our lib directory.

Contents