As an alternative to compiling code on the fly, we can always use the command line to perform the same function—Less comes with a built-in command-line compiler that requires the JavaScript-based Node platform to operate.
We took a look at how you can install Node in Chapter 2, Building a Less Development Toolkit; I will assume that you have installed it using the defaults, as outlined in that chapter. At this point, we now need to install the Less compiler, so bring up a command prompt, change to the location of the project folder we created earlier, and enter the following command:
npm install -g less
You will see it run through a download and install of Less at the command prompt:
Once the installation is complete, we can enter the following command to compile a Less file, which uses this syntax:
lessc srcfile [dstfile]
Less will compile the output to stdout
; if we want to use a different one, then we can redirect the output:
...