Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function processCSS(processor, input, output, fn) {
- function doProcess(css, fn) {
- function onResult(result) {
- if (typeof result.warnings === 'function') {
- result.warnings().forEach(console.error);
- }
- fn(null, result.css);
- }
- var result = processor.process(css, {
- safe: argv.safe,
- from: input,
- to: output
- });
- if (typeof result.then === 'function') {
- result.then(onResult).catch(fn);
- } else{
- process.nextTick(onResult.bind(null, result));
- }
- }
- async.waterfall([
- async.apply(readFile, input),
- doProcess,
- async.apply(writeFile, output)
- ], fn);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement