html-inject-css
v0.0.3
Published
Transform stream for injecting stylesheet tags into html.
Downloads
24
Readme
html-inject-css
Transform stream for injecting css tags into html.
example:
var injectCss = require('html-inject-css')
process.stdin
.pipe( injectCss(['./main.css', './extra.css']) )
.pipe( process.stdout )
input:
<html><head></head><body>hello</body></html>
output:
<html><head><link href="./main.css" rel=stylesheet><link href="./extra.css" rel=stylesheet></head><body>hello</body></html>
cli
cat index.html | htmlinjectcss "main.css" > output.html
Gotcha:
requires a head tag to be present in the src.