# html-compat

> Make HTML file compatible with legacy browsers by transpiling script and style tag.

Latest version **0.1.0** (published 2017-02-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install html-compat
pnpm add html-compat
yarn add html-compat
bun add html-compat
```

Provides the command `html-compat`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2017-02-06 |
| First published | 2017-02-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | egoist |
| Maintainers | rem |

## Links

- npm: https://www.npmjs.com/package/html-compat
- Repository: https://github.com/egoist/html-compat
- Homepage: https://github.com/egoist/html-compat#readme
- Issues: https://github.com/egoist/html-compat/issues
- npm.io page: https://npm.io/package/html-compat

## Dependencies (7)

- [cac](https://npm.io/package/cac.md) ^3.0.4
- [chalk](https://npm.io/package/chalk.md) ^1.1.3
- [cheerio](https://npm.io/package/cheerio.md) ^0.22.0
- [postcss](https://npm.io/package/postcss.md) ^5.2.12
- [babel-core](https://npm.io/package/babel-core.md) ^6.22.1
- [postcss-cssnext](https://npm.io/package/postcss-cssnext.md) ^2.9.0
- [babel-preset-env](https://npm.io/package/babel-preset-env.md) ^1.1.8

## Recent versions

- 0.1.0 (latest) — 2017-02-06

## README

# html-compat

[![NPM version](https://img.shields.io/npm/v/html-compat.svg?style=flat)](https://npmjs.com/package/html-compat) [![NPM downloads](https://img.shields.io/npm/dm/html-compat.svg?style=flat)](https://npmjs.com/package/html-compat) [![Build Status](https://img.shields.io/circleci/project/egoist/html-compat/master.svg?style=flat)](https://circleci.com/gh/egoist/html-compat) [![donate](https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000&style=flat)](https://github.com/egoist/donate)

## How does it work?

If you simply want to work with an `index.html` and love `ES2015`, `CSSnext` features, all `script` and `style` tags inside the html file will be transpiled to more compatible JS/CSS.

Here's nothing magic and worths studying, just a simple short-hand to reduce boilerplate code 😄

## Install

```bash
npm i -g html-compat
```

## Usage

```bash
html-compat input.html -o output.html

# help
html-compat -h
```

## API

```js
const htmlCompat = require('html-compat')

htmlCompat(`<html>html string</html>`, options)
  .then(result => {
    console.log(result)
  })
```

### options

#### browsers

Type: `Array`<br>
Default: `['ie > 8', 'last 4 versions']`

Support browsers down to this value.

## Contributing

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D


## Author

**html-compat** © [egoist](https://github.com/egoist), Released under the [MIT](./LICENSE) License.<br>
Authored and maintained by egoist with help from contributors ([list](https://github.com/egoist/html-compat/contributors)).

> [egoistian.com](https://egoistian.com) · GitHub [@egoist](https://github.com/egoist) · Twitter [@rem_rin_rin](https://twitter.com/rem_rin_rin)

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