From c4462612cc75f58692bb4fa71fb48a15569835c8 Mon Sep 17 00:00:00 2001 From: morishitter Date: Thu, 7 Apr 2016 19:41:07 +0900 Subject: [PATCH] update usage in Node.js --- README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ebf3062..8c9b907 100644 --- a/README.md +++ b/README.md @@ -297,14 +297,17 @@ $ cat input.css | stylefmt ```js var fs = require('fs'); var postcss = require('postcss'); -var fmt = require('stylefmt'); +var scss = require('postcss-scss'); // when you use scss syntax +var stylefmt = require('stylefmt'); var css = fs.readFileSync('input.css', 'utf-8'); -var output = postcss() - .use(fmt()) - .process(css) - .css; +postcss([ + stylefmt +]).process(css, { syntax: scss }) + .then(function (result) { + result.css; // formatted code + }); ``` ### in Task Runners