# atfcss

> Insert critical CSS into an html file

Latest version **1.0.0** (published 2014-10-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install atfcss
pnpm add atfcss
yarn add atfcss
bun add atfcss
```

Provides the command `atfcss`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2014-10-22 |
| First published | 2014-10-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Pablo Heredia |
| Maintainers | crowl |
| Keywords | css, insert, head, above the fold, atf |

## Links

- npm: https://www.npmjs.com/package/atfcss
- Repository: git@github.com:crowl/atfcss
- Homepage: https://github.com/crowl/atfcss
- Issues: https://github.com/crowl/atfcss/issues
- npm.io page: https://npm.io/package/atfcss

## Dependencies (3)

- [trumpet](https://npm.io/package/trumpet.md) ^1.7.0
- [minimist](https://npm.io/package/minimist.md) ^1.1.0
- [duplexer2](https://npm.io/package/duplexer2.md) 0.0.2

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2014-10-22
- 0.0.8 — 2014-10-21
- 0.0.7 — 2014-10-21
- 0.0.6 — 2014-10-21
- 0.0.5 — 2014-10-21
- 0.0.4 — 2014-10-21
- 0.0.3 — 2014-10-21
- 0.0.2 — 2014-10-20
- 0.0.1 — 2014-10-20

## README

# atfcss

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

# example

```javascript
// 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

```javascript
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

---
_Source: https://npm.io/package/atfcss · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
