1 | /**
|
2 | * Module dependencies
|
3 | */
|
4 |
|
5 | var read = require('fs').readFileSync;
|
6 | var Parser = require('./parser');
|
7 |
|
8 | /**
|
9 | * Transform the css to a module definition
|
10 | */
|
11 |
|
12 | exports = module.exports = function(css, opts) {
|
13 | var parser = new Parser(css, opts);
|
14 | return parser.toAst();
|
15 | };
|
16 |
|
17 | exports.file = function(file, opts) {
|
18 | opts = opts || {};
|
19 | opts.filename = file;
|
20 | return exports(read(file, 'utf8'), opts);
|
21 | };
|