Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

html-inject-css

0.0.3 • Public • Published

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.

install

npm i html-inject-css

Downloadsweekly downloads

11

version

0.0.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar