# neutrino-middleware-html-template

> Neutrino middleware for automatic HTML file generation from metadata

Latest version **7.4.0** (published 2017-12-04) · MPL-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install neutrino-middleware-html-template
pnpm add neutrino-middleware-html-template
yarn add neutrino-middleware-html-template
bun add neutrino-middleware-html-template
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 7.4.0 |
| Published | 2017-12-04 |
| First published | 2017-03-09 |
| Weekly downloads | 0 |
| License | MPL-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3905 |
| Author | Eli Perelman |
| Maintainers | eliperelman |
| Keywords | neutrino, neutrino-middleware, html, template |

## Links

- npm: https://www.npmjs.com/package/neutrino-middleware-html-template
- Repository: https://github.com/mozilla-neutrino/neutrino-dev/tree/master/packages/neutrino-middleware-html-template
- Homepage: https://neutrino.js.org
- Issues: https://github.com/mozilla-neutrino/neutrino-dev/issues
- npm.io page: https://npm.io/package/neutrino-middleware-html-template

## Dependencies (3)

- [deepmerge](https://npm.io/package/deepmerge.md) ^1.5.2
- [html-webpack-plugin](https://npm.io/package/html-webpack-plugin.md) ^2.30.1
- [html-webpack-template](https://npm.io/package/html-webpack-template.md) ^5.6.0

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 7.4.0 (latest) — 2017-12-04
- 7.3.3 — 2017-11-21
- 7.3.2 — 2017-11-13
- 7.3.1 — 2017-11-06
- 7.3.0 — 2017-10-31
- 7.2.3 — 2017-10-26
- 7.2.1 — 2017-10-21
- 7.1.10 — 2017-10-18
- 7.1.3 — 2017-10-17
- 7.1.2 — 2017-10-13
- 7.1.1 — 2017-10-10
- 7.1.0 — 2017-10-06
- 7.0.2 — 2017-10-03
- 7.0.1 — 2017-09-28
- 7.0.0 — 2017-09-28
- … 29 more at https://npm.io/package/neutrino-middleware-html-template/versions

## README

# Neutrino HTML Template Middleware

`neutrino-middleware-html-template` is Neutrino middleware for automatically creating HTML files for configured
entry-points.

[![NPM version][npm-image]][npm-url]
[![NPM downloads][npm-downloads]][npm-url]
[![Join the Neutrino community on Spectrum][spectrum-image]][spectrum-url]

## Requirements

- Node.js v6.10+
- Yarn or npm client
- Neutrino v7

## Installation

`neutrino-middleware-html-template` can be installed via the Yarn or npm clients.

#### Yarn

```bash
❯ yarn add neutrino-middleware-html-template
```

#### npm

```bash
❯ npm install --save neutrino-middleware-html-template
```

## Usage

`neutrino-middleware-html-template` can be consumed from the Neutrino API, middleware, or presets. Require this package
and plug it into Neutrino:

```js
// Using function middleware format
const template = require('neutrino-middleware-html-template');

// Usage shows default values
// Accepts options specified by HtmlWebpackTemplate
// https://github.com/jaketrent/html-webpack-template
neutrino.use(template, {
  inject: false,
  appMountId: 'root',
  xhtml: true,
  mobile: true,
  minify: {
    useShortDoctype: true,
    keepClosingSlash: true,
    collapseWhitespace: true,
    preserveLineBreaks: true
  }
});

// Most commonly, you will want to override the initial page title:
neutrino.use(template, {
  title: 'React Application'
});
```

```js
// Using object or array middleware format

// Usage shows default values
// Accepts options specified by HtmlWebpackTemplate
// https://github.com/jaketrent/html-webpack-template
module.exports = {
  use: [
    ['neutrino-middleware-html-template', {
      inject: false,
      appMountId: 'root',
      xhtml: true,
      mobile: true,
      minify: {
        useShortDoctype: true,
        keepClosingSlash: true,
        collapseWhitespace: true,
        preserveLineBreaks: true
      }
    }]
  ]
};

// Most commonly, you will want to override the initial page title:
module.exports = {
  use: [
    ['neutrino-middleware-html-template', {
      title: 'React Application'
    }]
  ]
};
```

## Customization

`neutrino-middleware-html-template` creates some conventions to make overriding the configuration easier once you are ready to
make changes.

### Plugins

The following is a list of plugins and their identifiers which can be overridden:

| Name | Description | Environments and Commands |
| --- | --- | --- |
| `html` | Automatically generates HTML files for configured entry-points. | all |

## Contributing

This middleware is part of the [neutrino-dev](https://github.com/mozilla-neutrino/neutrino-dev) repository, a monorepo
containing all resources for developing Neutrino and its core presets and middleware. Follow the
[contributing guide](https://neutrino.js.org/contributing) for details.

[npm-image]: https://img.shields.io/npm/v/neutrino-middleware-html-template.svg
[npm-downloads]: https://img.shields.io/npm/dt/neutrino-middleware-html-template.svg
[npm-url]: https://npmjs.org/package/neutrino-middleware-html-template
[spectrum-image]: https://withspectrum.github.io/badge/badge.svg
[spectrum-url]: https://spectrum.chat/neutrino

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