As you might have noticed from my previous post, My geekadellic franzy about node.js is reaching new peaks..
I’ve created a small node.js module to be used not as a web server, but more as an aid for developing frontend applications regardless of the backend technology used.
What the module does is:
- Searches for .less files, parses them, and saves two copies of the file:
E.g.
css/main.less
Will be transformed intocss/main.css
- parsed less to csscss/main.min.css
- parsed less to css and minified - Searches for .js files, minifies them:
E.g.
js/main.js
Will be minified and saved tojs/main.min.js
You can choose to search directories recursively, and if you wish to watch the files for changes, triggering a parsing/minification upon each save.
Each change triggers a growl notification, so you’ll be able to catch errors earlier:
Installing:
Install node.js and npm (see https://github.com/joyent/node/wiki/Installation ) Be sure to have the node library in your path!
Open up your terminal :
|
|
If everything works, you should now be able to do :
|
|
That’s it!
Roadmap:
Support combining files
Add images for Growl notifications (Info / Error) Done!
Add more optimizations (pngcrushing, html minification, sprites etc)
Node modules used:
The source is up at github