Skip to content

Instantly share code, notes, and snippets.

@idealhack
Last active December 14, 2017 03:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save idealhack/5210466 to your computer and use it in GitHub Desktop.
Save idealhack/5210466 to your computer and use it in GitHub Desktop.
Inline CSS Maker Using Juice
#!/usr/bin/env node
var juice = require('juice')
, fs = require('fs')
var read = function (file) {
return fs.readFileSync(file, 'utf8')
}
var compile = function (template) {
html = read('src/' + template + '.html')
css = read('src/stylesheets/style.css')
fs.writeFileSync(template + '.html', juice(html, css))
}
compile('template')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment