# documentify

> Modular HTML bundler

Latest version **3.2.3** (published 2020-04-25) · MIT license · 0 weekly downloads

## Install

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

Provides the command `documentify`.

## 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 | 3.2.3 |
| Published | 2020-04-25 |
| First published | 2017-07-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 19.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | andytjoslin, goto-bus-stop, rreusser, tgfjt, tuvistavie, yoshuawuyts |
| Keywords | html, document, transform, stream |

## Links

- npm: https://www.npmjs.com/package/documentify
- Repository: https://github.com/stackhtml/documentify
- Homepage: https://github.com/stackhtml/documentify#readme
- Issues: https://github.com/stackhtml/documentify/issues
- npm.io page: https://npm.io/package/documentify

## Dependencies (11)

- [pump](https://npm.io/package/pump.md) ^3.0.0
- [subarg](https://npm.io/package/subarg.md) ^1.0.0
- [resolve](https://npm.io/package/resolve.md) ^1.4.0
- [inherits](https://npm.io/package/inherits.md) ^2.0.3
- [from2-string](https://npm.io/package/from2-string.md) ^1.1.0
- [@choojs/findup](https://npm.io/package/@choojs/findup.md) ^0.2.0
- [fast-json-parse](https://npm.io/package/fast-json-parse.md) ^1.0.2
- [readable-stream](https://npm.io/package/readable-stream.md) ^3.0.0
- [async-collection](https://npm.io/package/async-collection.md) ^1.0.1
- [ansi-escape-sequences](https://npm.io/package/ansi-escape-sequences.md) ^3.0.0
- [labeled-stream-splicer](https://npm.io/package/labeled-stream-splicer.md) ^2.0.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

- 3.2.3 (latest) — 2020-04-25
- 3.2.2 — 2018-04-13
- 3.2.1 — 2018-03-02
- 3.2.0 — 2018-03-02
- 3.1.0 — 2017-11-18
- 3.0.0 — 2017-10-18
- 2.1.0 — 2017-09-21
- 2.0.2 — 2017-09-21
- 2.0.1 — 2017-09-19
- 2.0.0 — 2017-08-25
- 1.0.3 — 2017-08-07
- 1.0.2 — 2017-07-26
- 1.0.1 — 2017-07-24
- 1.0.0 — 2017-07-24

## README

# documentify [![stability][0]][1]
[![npm version][2]][3] [![build status][4]][5]
[![downloads][8]][9] [![js-standard-style][10]][11]

Modular HTML bundler.

## Usage
```txt
  $ documentify [entry-file] [options]

  Options:

    -h, --help        print usage
    -v, --version     print version

  Examples:

    Start bundling HTML
    $ documentify .

    Bundle HTML from a stream
    $ cat index.html | documentify

  Running into trouble? Feel free to file an issue:
  https://github.com/stackhtml/documentify/issues/new

  Do you enjoy using this software? Become a backer:
  https://opencollective.com/choo
```

## Configuring transforms
### Command Line
```sh
$ documentify ./index.html -t my-transform -t another-transform
```

### package.json
```json
{
  "name": "my-app",
  "version": "1.0.0",
  "private": true,
  "documentify": {
    "transform": [
      "my-transform",
      "another-transform"
    ]
  }
}
```

## Writing transforms
A transform is a regular function that returns a `through` stream. The
`through` stream can modify the HTML stream, which in turn passes data to the
next stream. Together the streams form a pipeline.

```js
var through = require('through2')

module.exports = transform

function transform (opts) {
  return through()
}
```

## API
### `document = documentify(entry, [html], [opts])`
Create a new documentify instance. If `entry` is a `.html` file, it'll be
used as the source. If `entry` is falsy and `html` is a string or readable
stream, that will be used as the input instead. Otherwise if `entry` is falsy
and `html` is omitted, an empty HTML file with just a body and head will be
used as the source.

### `document.transform(fn, [opts])`
Pass a transform to the document instance

### `readableStream = document.bundle()`
Create a new readable stream, and start flowing the html through the
transforms.

## See Also
- [substack/hyperstream](https://github.com/substack/hyperstream)
- [choojs/bankai](https://github.com/choojs/bankai)

## License
[MIT](https://tldrlegal.com/license/mit-license)

[0]: https://img.shields.io/badge/stability-experimental-orange.svg?style=flat-square
[1]: https://nodejs.org/api/documentation.html#documentation_stability_index
[2]: https://img.shields.io/npm/v/documentify.svg?style=flat-square
[3]: https://npmjs.org/package/documentify
[4]: https://img.shields.io/travis/stackhtml/documentify/master.svg?style=flat-square
[5]: https://travis-ci.org/stackhtml/documentify
[6]: https://img.shields.io/codecov/c/github/stackhtml/documentify/master.svg?style=flat-square
[7]: https://codecov.io/github/stackhtml/documentify
[8]: http://img.shields.io/npm/dm/documentify.svg?style=flat-square
[9]: https://npmjs.org/package/documentify
[10]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[11]: https://github.com/feross/standard

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