PHPackages                             codementality/stream-util - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. codementality/stream-util

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

codementality/stream-util
=========================

Helper utilities for dealing with streams. Forked and updated version of twistor/stream-util.

v2.0.0(1y ago)0129.3k—2.2%1MITPHPPHP &gt;=8.2.0CI passing

Since Mar 24Pushed 1y agoCompare

[ Source](https://github.com/codementality/stream-util)[ Packagist](https://packagist.org/packages/codementality/stream-util)[ Docs](http://github.com/codementality/stream-util)[ RSS](/packages/codementality-stream-util/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (1)

Stream Utilities
================

[](#stream-utilities)

This is a forked and updated version of the original package, twistor/stream-util.

[![Status)](https://github.com/codementality/stream-util/actions/workflows/tests.yml/badge.svg)](https://github.com/codementality/stream-util/actions/workflows/tests.yml/badge.svg)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Packagist Version](https://camo.githubusercontent.com/e2a663cc6cffe7f60eacdca996671b217fbde21db0f8ba80f9f6c56f83bc7a06/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f64656d656e74616c6974792f73747265616d2d7574696c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codementality/stream-util)

Helper functions for dealing with streams.

Installation
------------

[](#installation)

```
composer require codementality/stream-util

```

Usage
-----

[](#usage)

```
use Codementality\StreamUtil;

$stream = fopen('php://temp', 'w+b');

fwrite($stream, 'asdfasfdas');

$cloned = StreamUtil::copy($stream, false); // Passing in true (the default),
                                            // will close the input stream.

StreamUtil::getSize($stream); // 10

StreamUtil::isAppendable($stream); // false

StreamUtil::isReadable($stream); // true

StreamUtil::isSeekable($stream); // true

StreamUtil::isWritable($stream); // true

StreamUtil::tryRewind($stream);  // true

StreamUtil::trySeek($stream, 0, SEEK_END); // true

// Metadata helpers.
StreamUtil::getMetaDataKey($stream, 'blocked') // false

StreamUtil::getUri($stream); // php://temp

StreamUtil::getUsuableUri($stream); // Returns a URI that can be used
                                    // with fopen().
                                    // false in this case.

// Mode helpers.
StreamUtil::modeIsAppendable('w+'); // false

StreamUtil::modeIsAppendOnly('a+'); // false

StreamUtil::modeIsReadable('w+');   // true

StreamUtil::modeIsReadOnly('r');    // true

StreamUtil::modeIsWritable('r+');   // true

StreamUtil::modeIsWriteOnly('w');   // true
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance41

Moderate activity, may be stable

Popularity33

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 61.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

489d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/98bc4611d3303af9f09a0229162f1f47a26f3fb7324c114b6079f208780b6806?d=identicon)[codementality](/maintainers/codementality)

---

Top Contributors

[![twistor](https://avatars.githubusercontent.com/u/42400?v=4)](https://github.com/twistor "twistor (21 commits)")[![lhridley](https://avatars.githubusercontent.com/u/153297?v=4)](https://github.com/lhridley "lhridley (13 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codementality-stream-util/health.svg)

```
[![Health](https://phpackages.com/badges/codementality-stream-util/health.svg)](https://phpackages.com/packages/codementality-stream-util)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
