cssbeautifier

1.0.0 • Public • Published

cssbeautifier

Beautify css code

var cssbeautifier = require('cssbeautifier');

install

npm install cssbeautifier --save

test

mocha

API

cssbeautifier(str, options)

  • {string|readstream} str required
    The code string or file stream
  • {object} options
    • {string} indent [options.indent = ' ']
      Indent for css property
    • {boolean} ruleNewline [options.boolean = false]
      a new rule start with new line
    • {string} filepath
      useful for error message, if use read stream, you can optional this param.
    • {function} done
      when the first param is stream, it's async.
var css = cssbeautifier('a{color: red}');
 
// or stream
cssbeautifier(fs.createReadStream('path/demo.css'), {
  done: function(css) {
 
  }
})

Package Sidebar

Install

npm i cssbeautifier

Weekly Downloads

1

Version

1.0.0

License

ISC

Last publish

Collaborators

  • douzi