Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/oresoftware/prepend-transform

Uses a Node.js transform stream to prepend the given string to the front of each line.
https://github.com/oresoftware/prepend-transform

newline nodejs nodejs-stream nodejs-streams stderr stdout stream transform-streams

Last synced: 2 months ago
JSON representation

Uses a Node.js transform stream to prepend the given string to the front of each line.

Awesome Lists containing this project

README

        


[![Version](https://img.shields.io/npm/v/prepend-transform.svg?colorB=green)](https://www.npmjs.com/package/prepend-transform)

# Prepend-Transform

>
> Prepend text to the beginning of each line in a stream.
>

## Installation

```bash
npm install -S prepend-transform
```

## Usage

```javascript

import pt from 'prepend-transform';
import * as cp from 'child_process';

const n = cp.spawn('bash');

n.stdout.pipe(pt('child stdout: ')).pipe(process.stdout);
n.stderr.pipe(pt('child stderr: ')).pipe(process.stderr);

```