Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 102 lines (64 sloc) 1.852 kb
34cfea6 @xianhuazhou update readme
authored
1 # Introduction
2
c92cd73 @xianhuazhou Supported css(less, scss) files
authored
3 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.
34cfea6 @xianhuazhou update readme
authored
4 To make it works, you need to install nodejs(http://www.nodejs.org/) first.
5
6 ## Installation
7
d9213c0 @xianhuazhou updted README
authored
8 $ [sudo] npm install jmen -g
34cfea6 @xianhuazhou update readme
authored
9
10 ## Usage
11
12 $ jmen --file /path/to/app/dev/index.js --output /path/to/website/assets/javascripts/app.js
13
14 file: /path/to/app/dev/index.js
15
16 ```js
17 //= require "dev/a.js"
18 //= require "dev/b.js"
19 ```
20
c92cd73 @xianhuazhou Supported css(less, scss) files
authored
21 ### Compress generated code
34cfea6 @xianhuazhou update readme
authored
22
23 $ jmen --file js/index.js --output web/compiled/main.js --compress
24
c92cd73 @xianhuazhou Supported css(less, scss) files
authored
25 ### Mixing JavaScript and CoffeeScript
34cfea6 @xianhuazhou update readme
authored
26
27 file: js/main.js
28 ```js
29 //= require "a.js"
30 //= require "my/first.coffee"
31 // ....
32 ```
33
34 file: my/first.coffee
35
5366b28 @xianhuazhou code format
authored
36 ```coffee
34cfea6 @xianhuazhou update readme
authored
37 #= require "second.coffee"
38 #
39 # other coffee code here
40 ```
41
42 The files structure looks like:
43
44 js/
45 main.js
46 a.js
47 my/
48 first.coffee
49 second.coffee
50
d9213c0 @xianhuazhou updted README
authored
51 Then, you can do it with jmen:
52
53 $ jmen --file js/main.js --output result.js
54
c92cd73 @xianhuazhou Supported css(less, scss) files
authored
55 ### Working with less files
56
57 $ jmen -f less/index.scss -o css/app.css
58
59 file: less/index.scss
60
61 ```scss
a8e35c1 @xianhuazhou Typo fixes
authored
62 //= require "header.less"
63 //= require "bottom.less"
c92cd73 @xianhuazhou Supported css(less, scss) files
authored
64 // others ...
65 ```
66
67 ### Working with scss files (require Ruby's sass gem)
68
69 $ jmen -f scss/index.scss -o css/app.css [-s /path/to/scss]
70
71 file: scss/index.scss
72
73 ```scss
a8e35c1 @xianhuazhou Typo fixes
authored
74 //= require "header.scss"
75 //= require "bottom.scss"
c92cd73 @xianhuazhou Supported css(less, scss) files
authored
76 // others ...
77 ```
78
23fb8f6 @xianhuazhou 0.5.0 is ready
authored
79 ### Notice
80
81 Included files can be added onto top only !!!
82
c92cd73 @xianhuazhou Supported css(less, scss) files
authored
83 ### Run once and quit
84
85 If you just need to generate or compress your css/js files once, just do it with the `--run-once`(`-r`) option, e.g.:
86
87 $ jmen -f index.js -o compiled.js -c -r
88
d9213c0 @xianhuazhou updted README
authored
89 ### help
90
91 $ jmen --help
92
12a68be @xianhuazhou todo
authored
93 ## Latest Version
34cfea6 @xianhuazhou update readme
authored
94
a8e35c1 @xianhuazhou Typo fixes
authored
95 0.5.0
34cfea6 @xianhuazhou update readme
authored
96
12a68be @xianhuazhou todo
authored
97 ## TODO
98
99 Test
100
34cfea6 @xianhuazhou update readme
authored
101 It's similar to the Ruby's sprockets (http://www.getsprockets.org) gem.
Something went wrong with that request. Please try again.