File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 22
33 JavaScript CSS parser for nodejs and the browser.
44
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+
527## Example
628
729css:
@@ -110,6 +132,11 @@ on `node.position.source`.
110132
111133 Parsed 15,000 lines of CSS (2mb) in 40ms on my macbook air.
112134
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+
113140## License
114141
115142 MIT
You can’t perform that action at this time.
0 commit comments