From the course: Building Your First CLI App in Node

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Create a repository

Create a repository

From the course: Building Your First CLI App in Node

Start my 1-month free trial

Create a repository

- [Instructor] Before we can use the code we just added to the inquirer.js file, we also have to add some create a repository functions in our create_a_repo.js file. So let's go into our lib folder and then into our create_a_repo.js file. At the beginning of the file, load all of your dependencies, packages, and modules. This should include lodash, fs, and your two files inquirer and github_credentials. We're also going to make use of simple-git here. This is a helper for running git commands. Again, begin by creating module.exports. And this is going to contain an object we will name createRemoteRepository, which will run an async function with two newly created consts. The first is going to be github, and this will retrieve an instance of the octokit that we set up in our inquirer file. The other const we need to set up is answers, and what this will do is just retrieve the answers we've created in our askRepositoryDetails. Finally, we'll create a const called data, and this is…

Contents