<commit_before># simple-html-index

[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

A tiny through stream that returns a bare-bones HTML5 template with an optional
`<link>` and `<title>` in the head and `<script>` entry-point in the body.

## Example

In `html.js`

```js
var html = require('simple-html-index')

html({ title: 'hello', entry: 'bundle.js' })
  .pipe(process.stdout)
```

Now run `node html.js > index.html` and you would end up with a file that looks like this: (after formatting)

```html
<!doctype html>
<head>
  <title>hello</title>
  <meta charset="utf-8">
  </head>
<body>
  <script src="bundle.js"></script>
</body>
</html>
```

## Usage

[![NPM](https://nodei.co/npm/simple-html-index.png)](https://www.npmjs.com/package/simple-html-index)

#### `stream = html([opt])`

Returns a through stream that writes a bare-bones HTML template, with the following optional features:

- `title` whether to include a `<title>` element
- `entry` if specified, will add a `<script src={{entry}}>` element
- `css` if specified will add a `<link rel="stylesheet" href={{css}}>` element

## License

MIT, see [LICENSE.md](http://github.com/mattdesl/simple-html-index/blob/master/LICENSE.md) for details.
<commit_msg>docs: add additional properties section to readme<commit_after># simple-html-index

[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

A tiny through stream that returns a bare-bones HTML5 template with an optional
`<link>` and `<title>` in the head and `<script>` entry-point in the body.

## Example

In `html.js`

```js
var html = require('simple-html-index')

html({ title: 'hello', entry: 'bundle.js' })
  .pipe(process.stdout)
```

Now run `node html.js > index.html` and you would end up with a file that looks like this: (after formatting)

```html
<!doctype html>
<head>
  <title>hello</title>
  <meta charset="utf-8">
  </head>
<body>
  <script src="bundle.js"></script>
</body>
</html>
```

## Usage

[![NPM](https://nodei.co/npm/simple-html-index.png)](https://www.npmjs.com/package/simple-html-index)

#### `stream = html([opt])`

Returns a through stream that writes a bare-bones HTML template, with the following optional features:

- `title` whether to include a `<title>` element
- `entry` if specified, will add a `<script src={{entry}}>` element
- `css` if specified will add a `<link rel="stylesheet" href={{css}}>` element

## Additional properties
Combine `simple-html-index` with
[`hyperstream`](https://github.com/substack/hyperstream) to add additional
properties to html. An example how to add an extra `<script>` tag to the body
tag:
```js
const hyperstream = require('hyperstream')
const html = require('simple-html-index')

const htmls = html({ entry: 'static/bundle.js' })
const hs = hyperstream({
  body: { _appendHtml: "<script>console.log('extra tags!')</script>" }
})

htmls.pipe(hs).pipe(process.stdout)
```

## License

MIT, see [LICENSE.md](http://github.com/mattdesl/simple-html-index/blob/master/LICENSE.md) for details.

{'fraction_non_alphanumeric': 0.17422050787528126, 'fraction_numerical': 0.0012857602057216328, 'mean_word_length': 4.720588235294118, 'pattern_counts': {'":': 0, '<': 40, '<?xml version=': 0, '>': 42, 'https://': 5, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6211962', 'n_tokens_mistral': 1065, 'n_tokens_neox': 1019, 'n_words': 299}