File tree 3 files changed +34
-0
lines changed
3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ 1.4.0 / 2013-XX-XX
2
+ ==================
3
+
4
+ * source map generation
1
5
2
6
1.3.2 / 2013-10-18
3
7
==================
Original file line number Diff line number Diff line change 2
2
3
3
CSS compiler using the AST provided by [ css-parse] ( https://github.com/visionmedia/css-parse ) .
4
4
5
+ ## Usage
6
+
7
+ ` css-stringify ` exports a single function which dumps CSS AST:
8
+
9
+ var stringify = require('css-stringify');
10
+ var parse = require('css-parse');
11
+
12
+ var ast = parse('body { font-size: 12px; }');
13
+
14
+ var str = stringify(ast);
15
+
16
+ To get compressed output:
17
+
18
+ var compressed = stringify(ast, {compress: true});
19
+
20
+ To get a source map:
21
+
22
+ var result = stringify(ast, {sourcemap: true});
23
+
24
+ result.code // string with CSS
25
+ result.map // source map
26
+
5
27
## Performance
6
28
7
29
Formats 15,000 lines of CSS (2mb) in 23ms on my macbook air.
Original file line number Diff line number Diff line change @@ -11,6 +11,14 @@ var Identity = require('./lib/identity');
11
11
*
12
12
* @param {Object } node
13
13
* @param {Object } [options]
14
+ * @param {Boolean } [options.sourcemap] generate source map,
15
+ * if set to true this will change return value to
16
+ * `{code: '...', map: {...}}`, `node` argument should contain
17
+ * position information (e.g. parsed by css-parse with
18
+ * `position` option set to `true`)
19
+ * @param {Boolean } [options.compress] compress output (ignores indent option)
20
+ * @param {String } [options.indent] a string used for indents (defaults to 2 spaces)
21
+ *
14
22
* @return {String }
15
23
* @api public
16
24
*/
You can’t perform that action at this time.
0 commit comments