Skip to content

Commit

Permalink
update usage in Node.js
Browse files Browse the repository at this point in the history
  • Loading branch information
matype committed Apr 7, 2016
1 parent 0eb3c0f commit c446261
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c446261

Please sign in to comment.