Stream.insert()

Insert content before or after a string

Usage

Hover over inputs/exits for more info.

var Stream = require('machinepack-stream');


// Insert content before or after a string

Stream.insert({

text: 'a string to insert',

stream: '*',

after: '*',

before: '*',

}).execSync();

Inputs

text required

Insert a string before of after a string

'a string to insert'
stream

A readable stream

after

a string or string's array to search and insert text after

before

a string or string's array to search and insert text before

Exits

error

An unexpected error occurred.

errorNotStream

It's not a valid stream

success

OK.