lesscompile

compilation of project's less

less-compiler

The main purpose of the module is to compile your .less files automatically. It uses watchr to monitor a specific folder for changes and less for compilation. There are some other tools for the same purpose (less-middleware, less-watch) out there, but I needed completelly node based thingy - without the usage of the command line. I.e. something that I could add in my node project.

NodeJS

require("less-compiler").init({
    "pathToWatch": [path to your less files],
    "fileToCompile": [your main less file],
    "destination": [.css file as a destination]
});

example:

require("less-compiler").init({
    "pathToWatch": __dirname + "/less",
    "fileToCompile": __dirname + "/less/main.less",
    "destination": __dirname + "/compiled/styles.css"
});

The usage of absolute paths is recommended.