documentify
Modular HTML bundler
Last updated 6 months ago by goto-bus-stop .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install documentify 
SYNC missed versions from official npm registry.

documentify stability

npm version build status downloads js-standard-style

Modular HTML bundler.

Usage

  $ 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

$ documentify ./index.html -t my-transform -t another-transform

package.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.

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

License

MIT

Current Tags

  • 3.2.3                                ...           latest (6 months ago)

14 Versions

  • 3.2.3                                ...           6 months ago
  • 3.2.2                                ...           3 years ago
  • 3.2.1                                ...           3 years ago
  • 3.2.0                                ...           3 years ago
  • 3.1.0                                ...           3 years ago
  • 3.0.0                                ...           3 years ago
  • 2.1.0                                ...           3 years ago
  • 2.0.2                                ...           3 years ago
  • 2.0.1                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 15
Dependencies (11)
Dev Dependencies (7)

Copyright 2014 - 2016 © taobao.org |