0.1.0 • Published 9 years ago

json-sass-obj v0.1.0

Weekly downloads
2
License
ISC
Repository
github
Last release
9 years ago

json-sass-obj

Object mode wrapper for jsonSass

Usage Example

var File = require("vinyl")
var jsonSassObj = require("json-sass-obj")

var fakeFile = new File({
  path: "path/to/some.json",
  contents: new Buffer(JSON.stringify({
    "foo" : "baz",
    "bee" : [1,2,3]
  }))
})
var stream = jsonSassObj({
  prefix: "$someItem: ",
  suffix: " !default;"
})
stream.write(fakeFile)
stream.once('data', function(file){
  var scss = file.contents.toString()
  // scss
  //
  // $someItem: (
  //  foo: baz,
  //  bee: (1, 2, 3)
  // ) !default

  // file.path === "path/to/some.scss"

})