VS Code, New Project in Windows Command

Eric Bishard - Nov 7 '18 - - Dev Community

Now a days with the time we spend in our terminals it's nice to know how to do very basic things without leaving the terminal. So what would we need to do if we had to create a new directory, initialize a project, create a index file and open that file in a code editor. It's actually pretty simple and I only have trouble ever, remembering one part of it. The steps are as follows:

First we may need to get to whatever directory we want to create our project directory, for instance. If that were in my projects folder it might look like this:

cd C:\projects
Enter fullscreen mode Exit fullscreen mode

Next, we need to create our project folder:

mkdir super-cool-project
Enter fullscreen mode Exit fullscreen mode

Again we need to change directories to get us inside:

cd super-cool-project
Enter fullscreen mode Exit fullscreen mode

Now we need to initialize a git repository to track our changes on the project:

git init
Enter fullscreen mode Exit fullscreen mode

And while we're at it, we need to bring in the ability to work with NPM. This will prompt us to create our default config for the project.

npm init
Enter fullscreen mode Exit fullscreen mode

Finally to get started, we are just going to create an index.html file, but in reality this could be an index.js or whatever initial file you want to start working on.

type nul > index.html
Enter fullscreen mode Exit fullscreen mode

Open in Visual Studio Code:

code .
Enter fullscreen mode Exit fullscreen mode
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .