<commit_before># read-stream

Base class for readable streams

## Example array

```
var from = require("read-stream")
    , stream = from(["one", "two"])

stream.pipe(process.stdout)
```

## Example function

```
var from = require("read-stream")
    // buffer is a shared array amongst all read calls
    , stream = from(function read(bytes, buffer) {
        var count = buffer.count = ++buffer.count || 0

        if (count < 5) {
            return count.toString()    
        } else {
            this.emit("end")
        }
    })

stream.pipe(process.stdout)
```

## Installation

`npm install read-stream`

## Contributors

 - Raynos

## MIT Licenced<commit_msg>updated docs<commit_after># read-stream

Base class for readable streams

## Example array

```
var from = require("read-stream")
    , stream = from(["one", "two"])

stream.pipe(process.stdout)
```

## Example function

```
var from = require("read-stream")
    // buffer is a shared array amongst all read calls
    , stream = from(function read(bytes, state) {
        var count = ++state.count

        if (count < 5) {
            return count.toString()    
        } else {
            this.emit("end")
        }
    }, { count: 0 })

stream.pipe(process.stdout)
```

## Installation

`npm install read-stream`

## Contributors

 - Raynos

## MIT Licenced
{'fraction_non_alphanumeric': 0.14403600900225055, 'fraction_numerical': 0.003000750187546887, 'mean_word_length': 2.576407506702413, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '273316', 'n_tokens_mistral': 420, 'n_tokens_neox': 398, 'n_words': 110}