index.js 467 B

123456789101112131415161718192021
  1. 'use strict'
  2. var html = require('./compile/html.js')
  3. var parse = require('./parse.js')
  4. var postprocess = require('./postprocess.js')
  5. var preprocess = require('./preprocess.js')
  6. function buffer(value, encoding, options) {
  7. if (typeof encoding !== 'string') {
  8. options = encoding
  9. encoding = undefined
  10. }
  11. return html(options)(
  12. postprocess(
  13. parse(options).document().write(preprocess()(value, encoding, true))
  14. )
  15. )
  16. }
  17. module.exports = buffer