WEBVTT 0 00:00.660 --> 00:10.320 Now REPL stands for Read Evaluation Print Loop, and it basically allows you to execute code in bite sized 1 00:10.320 --> 00:15.930 chunks, just like what we did with the Chrome Developer Tools Console inside Chrome. 2 00:15.930 --> 00:21.270 We were able to write a single line of code and then hit enter and it would run that line of code and 3 00:21.270 --> 00:23.940 then we could run another line of code etc.. 4 00:23.970 --> 00:31.830 So by installing Node, we also installed the Node REPL, and to access it all we do is write the command 5 00:31.920 --> 00:35.360 node inside the command line and hit enter. 6 00:35.550 --> 00:39.770 And once you see that little angle bracket, then you know you're inside the REPL. 7 00:40.020 --> 00:42.540 So here we can write code directly. 8 00:42.540 --> 00:46.480 So for example, I could write console.log 9 00:46.680 --> 00:52.960 (“Hey there!”), and if I hit enter then it will execute it straight away. 10 00:53.180 --> 00:58.820 And we should be pretty familiar with this already, as it works pretty much the same as our Chrome Console. 11 00:58.820 --> 01:08.060 So we can also execute other bits of code, for example 3 + 5 equals 8, or “Angela “ + 12 01:08.480 --> 01:12.800 “Yu” will be my name, Angela Yu, as a string. 13 01:13.070 --> 01:17.960 And it's also got short cuts, like, for example, if we didn't feel like writing out the entirety of console.log 14 01:17.960 --> 01:21.050 we can write con, tab, 15 01:21.230 --> 01:27.320 and if one tab doesn't give you any results, you can tab again and that will give you all the possible 16 01:27.320 --> 01:28.540 commands that you can use 17 01:28.540 --> 01:29.430 at this point. 18 01:29.660 --> 01:33.020 So you can use console, constructor, continue. 19 01:33.200 --> 01:34.640 So we want console. 20 01:34.700 --> 01:38.810 So console, and then we can write dot and I tap twice, 21 01:38.810 --> 01:41.790 then I can see all of the different possibilities. Now 22 01:41.810 --> 01:46.640 sometimes, while you're working in the command line, one of the most difficult things can be figuring 23 01:46.640 --> 01:49.830 out how to exit the process that you're currently in. 24 01:49.850 --> 01:57.740 Now, in order to exit the REPL, you can either say .exit and hit enter, or you can simply hit Control 25 01:57.740 --> 02:06.560 C twice. And in a lot of cases in the future, when we're running servers, or when we’re starting processes, Control C 26 02:06.770 --> 02:10.690 will usually get out of any process that you're running at that time. 27 02:10.820 --> 02:16.220 And if you wanted to clear your console, you can simply just write clear, and it will delete all of the 28 02:16.220 --> 02:17.710 previous commands. 29 02:17.720 --> 02:22.570 Now that was a little brief intro into what you can do using the Node REPL. 30 02:22.790 --> 02:28.520 Now in the next lesson, we're going to look at how you can use some native node modules, so packages of 31 02:28.550 --> 02:34.820 code, that's been bundled into Node that we can use to make our lives easier and to perform some really 32 02:34.820 --> 02:36.610 simple functionality. 33 02:36.650 --> 02:39.430 So for all of that and more, I'll see you on the next lesson.