Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

pad-stream

2.0.0 • Public • Published

pad-stream Build Status

Pad each line in a stream

Install

$ npm install --save pad-stream

Usage

// pad.js
const padStream = require('pad-stream');
 
process.stdin.pipe(padStream(2, '>')).pipe(process.stdout);
$ echo 'foo\nbar' | node pad.js
>>foo
>>bar

API

padStream(count, [indent])

Returns a transform stream.

count

Type: number (integer)

Number of times to repeat indent.

indent

Type: string
Default: ' '

String to use as indent.

Related

License

MIT © Sindre Sorhus

Install

npm i pad-stream

DownloadsWeekly Downloads

62,736

Version

2.0.0

License

MIT

Last publish

Collaborators

  • avatar