jmen

watch javascript(coffeescript) and css(scss, less) files, merge them into one file whenever one of the watched files is updated.

npm install jmen
10 downloads in the last week
25 downloads in the last month

Introduction

jmen is a tool can merge javascript (including coffeescript) and css (including scss, less) files into one file whenever one of the included files is updated. To make it works, you need to install nodejs(http://www.nodejs.org/) first.

Installation

$ [sudo] npm install jmen -g

Usage

$ jmen --file /path/to/app/dev/index.js --output /path/to/website/assets/javascripts/app.js

file: /path/to/app/dev/index.js

    //= require "dev/a.js"
    //= require "dev/b.js"

Compress generated code

$ jmen --file js/index.js --output web/compiled/main.js --compress

Mixing JavaScript and CoffeeScript

file: js/main.js

    //= require "a.js"
    //= require "my/first.coffee"
    // ....

file: my/first.coffee

    #= require "second.coffee"
    # 
    # other coffee code here

The files structure looks like:

js/
  main.js
  a.js
  my/
    first.coffee
    second.coffee

Then, you can do it with jmen:

$ jmen --file js/main.js --output result.js

Working with less files

$ jmen -f less/index.scss -o css/app.css

file: less/index.scss

  //= header.less
  //= bottom.less
  // others ...

Working with scss files (require Ruby's sass gem)

$ jmen -f scss/index.scss -o css/app.css [-s /path/to/scss]

file: scss/index.scss

  //= header.scss
  //= bottom.scss
  // others ...

Notice

Included files can be added onto top only !!!

Run once and quit

If you just need to generate or compress your css/js files once, just do it with the --run-once(-r) option, e.g.:

$ jmen -f index.js -o compiled.js -c -r

help

$ jmen --help

Latest Version

0.4.0

TODO

Test

It's similar to the Ruby's sprockets (http://www.getsprockets.org) gem.

npm loves you