DEV Community


VS Code, New Project in Windows Command

httpjunkie profile image Eric Bishard Updated on ・1 min read

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

Next, we need to create our project folder:

mkdir super-cool-project

Again we need to change directories to get us inside:

cd super-cool-project

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

git init

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

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

Open in Visual Studio Code:

code .


Editor guide