Skip to content

Commit b5676e0

Browse files
committed
Update README.md
1 parent b5c74b2 commit b5676e0

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,23 @@ to make the same change in the parser.
1616
However, it may still be useful to someone in production,
1717
as it is intended to fully and completely match browser behavior
1818
(at least, as much as the final spec does).
19+
20+
Using the Library
21+
-----------------
22+
23+
The functionality is spread across two files for organizational purposes.
24+
The tokenizer.js file comes first -
25+
call the tokenize() function with a string containing CSS,
26+
and it will return an array of CSS tokens.
27+
parser.js comes next -
28+
call parse() with an array of CSS tokens,
29+
and it will return a stylesheet object
30+
implementing a very simple tree of rules.
31+
32+
Node Integration
33+
----------------
34+
35+
Simon Sapin added some CommonJS export statements to the bottom of tokenizer.js and parser.js
36+
exporting the tokenize and parse functions,
37+
so as far as I know it will Just Work(tm).
38+
I have no idea how to fix it if anything goes wrong, though.

0 commit comments

Comments
 (0)