File tree 1 file changed +27
-0
lines changed
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
JavaScript CSS parser for nodejs and the browser.
4
4
5
+ ## Installation
6
+
7
+ $ npm install css-parse
8
+
9
+ ## Usage
10
+
11
+ ```` javascript
12
+ var parse = require (' css-parse' );
13
+
14
+ // CSS input string
15
+ var css = " body { \n background-color: #fff;\n }" ;
16
+
17
+ var output_obj = parse (css);
18
+
19
+ // Position and Source parameters
20
+ var output_obj_pos = parse (css, { position: true , source: ' file.css' });
21
+
22
+ // Print parsed object as CSS string
23
+ console .log (JSON .stringify (output_obj, null , 2 ));
24
+
25
+ ````
26
+
5
27
## Example
6
28
7
29
css:
@@ -110,6 +132,11 @@ on `node.position.source`.
110
132
111
133
Parsed 15,000 lines of CSS (2mb) in 40ms on my macbook air.
112
134
135
+ ## Related
136
+
137
+ [ css-stringify] ( https://github.com/visionmedia/css-stringify " CSS-Stringify ")
138
+ [ css-value] ( https://github.com/visionmedia/css-value " CSS-Value ")
139
+
113
140
## License
114
141
115
142
MIT
You can’t perform that action at this time.
0 commit comments