https://github.com/ljharb/resumer
a through stream that starts paused and resumes on the next tick
https://github.com/ljharb/resumer
Last synced: 7 days ago
JSON representation
a through stream that starts paused and resumes on the next tick
- Host: GitHub
- URL: https://github.com/ljharb/resumer
- Owner: ljharb
- License: mit
- Created: 2023-07-18T06:13:55.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-09T17:35:52.000Z (over 1 year ago)
- Last Synced: 2025-04-27T03:22:42.480Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 50.8 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# @ljharb/resumer [![Version Badge][npm-version-svg]][package-url]
*Note*: This package is a fork of https://npmjs.com/resumer, and builds off of it.
Return a through stream that starts out paused and resumes on the next tick, unless somebody called `.pause()`.
This module has the same signature as [through](https://npmjs.com/package/through).
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url][![npm badge][npm-badge-png]][package-url]
# example
``` js
var resumer = require('resumer');
var s = createStream();
s.pipe(process.stdout);function createStream () {
var stream = resumer();
stream.queue('beep boop\n');
return stream;
}
``````
$ node example/resume.js
beep boop
```# methods
``` js
var resumer = require('@ljharb/resumer')
```## resumer(write, end)
Return a new through stream from `write` and `end`, which default to pass-through `.queue()` functions if not specified.
The stream starts out paused and will be resumed on the next tick unless you call `.pause()` first.
`write` and `end` get passed directly through to [through](https://npmjs.com/package/through).
# install
With [npm](https://npmjs.org) do:
```
npm install @ljharb/resumer
```# license
MIT
[package-url]: https://npmjs.org/package/@ljharb/resumer
[npm-version-svg]: https://versionbadg.es/ljharb/resumer.svg
[deps-svg]: https://david-dm.org/ljharb/resumer.svg
[deps-url]: https://david-dm.org/ljharb/resumer
[dev-deps-svg]: https://david-dm.org/ljharb/resumer/dev-status.svg
[dev-deps-url]: https://david-dm.org/ljharb/resumer#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/@ljharb/resumer.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/@ljharb/resumer.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/@ljharb/resumer.svg
[downloads-url]: https://npm-stat.com/charts.html?package=@ljharb/resumer
[codecov-image]: https://codecov.io/gh/ljharb/resumer/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/ljharb/resumer/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/resumer
[actions-url]: https://github.com/ljharb/resumer/actions