File: pause.md

package info (click to toggle)
node-jszip 3.5.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 25,100 kB
  • sloc: javascript: 5,652; makefile: 2; sh: 2
file content (25 lines) | stat: -rw-r--r-- 501 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
---
title: "pause()"
layout: default
section: api
---

Pause the stream if the stream is running. Once paused, the
stream stops sending `data` events.

__Returns__ : The current StreamHelper object, for chaining.

## Example

```js
zip
.generateInternalStream({type:"uint8array"})
.on('data', function(chunk) {

    // if we push the chunk to an other service which is overloaded, we can
    // pause the stream as backpressure.
    this.pause();

}).resume(); // start the stream the first time
```