pausing-transform

1.0.1 • Public • Published

Pausing Transform

A transform stream that will buffer data written until flushed. I'm using this hold and transform my rendered output before it's written to the express response object so that I can still add headers after rendering has started.

Usage

The example below holds the data written until it is flushed (or end() is called) and then transforms it to upper case. The transform function is optional.

let PausingTransform = require('pausing-transform')

let pausing = new PausingTransform((chunk) => chunk.toString().toUpperCase())
pausing.pipe(res)
pausing.write('something here')
pausing.end()

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    5
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    5
  • 1.0.0
    0

Package Sidebar

Install

npm i pausing-transform

Weekly Downloads

5

Version

1.0.1

License

ISC

Unpacked Size

2.3 kB

Total Files

3

Last publish

Collaborators

  • dankolz