Created
November 17, 2016 20:15
-
-
Save rosado/26b86dbe13219249f99e6568c0a9fc55 to your computer and use it in GitHub Desktop.
inline-css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var options = { | |
'url': '/foo/bar/' | |
} | |
var inlineCss = require('inline-css') | |
var fs = require('fs') | |
fs.readFile('/Users/foo/Downloads/index.htm', 'utf8', function (err, data){ | |
if (err){ | |
return console.log(err); | |
} | |
inlineCss(data, options).then(function(html) { | |
console.log(html); | |
fs.writeFile('/Users/foo/Downloads/generated.htm', html, function (err) { | |
console.log(err); | |
}) | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment