UNPKG

432 BJavaScriptView Raw
1let less = require('less')
2let sass2less = require('./lib/plugin')
3let fs = require('fs')
4let file
5
6// get a file
7fs.readFile('./node_modules/material-design-lite/src/_variables.scss', 'utf-8', function(err, contents) {
8 if(err) return console.log(err)
9 file = contents
10
11 less.render(file, {
12 plugins: [sass2less]
13 }).then(function(output) {
14 console.log(output.css)
15 }, function (error) {
16 console.log(error)
17 })
18})