1.0.0 • Published 11 years ago

atfcss v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
11 years ago

atfcss

Insert critical css into the first <style> tag of an html file.

example

// atfcss.js

var atfcss = require('atfcss')
var path = require('path')

process.stdin
  .pipe(atfcss(path.resolve(__dirname, process.argv[2])))
  .pipe(process.stdout)

process.stdout.on('error', function () {})
$ cat critical.css | node atfcss.js source.html > final.html

methods

var atfcss = require('atfcss')

var stream = atfcss(htmlPath)

Return a transform stream. Pipe a CSS stream into stream and get back a version of the HTML file at htmlPath with the CSS inserted into its first <style> tag.

usage

This package also comes with a atfcss command:

usage: atfcss [html file] {OPTIONS}
 
  -i, --infile   Read input from a CSS file. Default: "-" (stdin) 
  -o, --outfile  Write output to a HTML file. Default: "-" (stdout)
  -h, --help     Show this message.

install

With npm do:

npm install atfcss

Or to get the command, do:

npm install atfcss -g

license

MIT

1.0.0

11 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago