1 00:00:00,390 --> 00:00:02,550 Hello and welcome to this video. 2 00:00:03,090 --> 00:00:08,940 In this video, I'm going to initialize, he knew no doubt this project. 3 00:00:09,330 --> 00:00:15,300 Open up your command prompt if you on a Windows computer or your terminal. 4 00:00:15,330 --> 00:00:19,260 If you're on a Mac, I'm going to create the project directory. 5 00:00:19,650 --> 00:00:21,540 You can create it any way you like. 6 00:00:22,050 --> 00:00:27,090 I want to create it on my desktop, so I'm going to change directory to my desktop. 7 00:00:27,090 --> 00:00:35,370 So I've typed in C the space desktop and press enter, and that takes me into my desktop directory. 8 00:00:35,940 --> 00:00:43,500 So this is where I want to create my project directory to create a new directory. 9 00:00:44,040 --> 00:00:46,620 You just type in empty space. 10 00:00:46,890 --> 00:00:54,510 The name of your directory, I've called my directory BLS, so I'm going to press enter and that you 11 00:00:54,510 --> 00:00:58,010 create a new folder on my desktop. 12 00:00:58,020 --> 00:01:03,780 You can see the folder here that has been created, which is called Bless. 13 00:01:03,780 --> 00:01:08,670 The next step is to change directory into the folder I just created. 14 00:01:09,180 --> 00:01:11,760 So you do that by typing in see this space. 15 00:01:12,270 --> 00:01:20,130 The name of the directory you just created, I'm press enter and that takes you into that directory 16 00:01:20,490 --> 00:01:30,240 to initialize a new Node.js project, you type in npm space init space. 17 00:01:30,390 --> 00:01:40,890 That's why the npm init command is a step by step tool that you can use to scaffold out your project. 18 00:01:41,400 --> 00:01:48,950 So it will prompt you for a variety of questions which you can answer yes or no to by using the dash. 19 00:01:49,470 --> 00:01:59,550 After the npm space in it, it will answer yes to any prompts that npm might display on the screen. 20 00:01:59,970 --> 00:02:05,220 So I'm just going to press enter to that and then you can see what it does. 21 00:02:05,670 --> 00:02:07,590 So you can see you. 22 00:02:08,010 --> 00:02:15,780 Usually it'll prompt you for an answer to all this, but because I've used it, that's why it automatically 23 00:02:15,780 --> 00:02:18,960 accepted all the default prompts. 24 00:02:19,470 --> 00:02:23,310 I've got my code editor open, which is Visual Studio code. 25 00:02:23,730 --> 00:02:32,670 So if I want to view the project folder inside my code editor, I just drag the folder and drop it in 26 00:02:32,670 --> 00:02:40,170 my editor, and that will enable me to view the files and the project so you might get this prompt that 27 00:02:40,170 --> 00:02:40,770 pops up. 28 00:02:41,340 --> 00:02:44,670 Just click on the checkbox and click Trust. 29 00:02:45,540 --> 00:02:50,610 So I now have my project directory inside my code editor. 30 00:02:51,150 --> 00:03:00,090 So if I click on the package toward JS on file, which was created using the npm command, you can see 31 00:03:00,330 --> 00:03:03,780 the content of the package JSON file. 32 00:03:04,350 --> 00:03:10,740 All Node.js projects should contain a package, thought Jason File. 33 00:03:10,740 --> 00:03:21,210 When the project is initialized, the Potato JS on file basically contains important metadata information 34 00:03:21,600 --> 00:03:23,160 about the project. 35 00:03:23,430 --> 00:03:36,270 It also defines functional attributes of a project that npm uses to install dependencies to run scripts 36 00:03:36,660 --> 00:03:44,610 and also to identify the entry point into an application or package.