Erik Zaadi

The tales of a developer with passion for dad jokes

Node.js Frontend Fu (node-fe-fu)

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:

  1. Searches for .less files, parses them, and saves two copies of the file: E.g. css/main.less Will be transformed into css/main.css - parsed less to css css/main.min.css - parsed less to css and minified
  2. Searches for .js files, minifies them: E.g. js/main.js Will be minified and saved to js/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:

Info growl

Error Growl

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 :

1
npm install fe-fu

If everything works, you should now be able to do :

1
fe-fu --jsDir ./js --lessDir ./css

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

Share on: