Skip to content

derhuerst/line-length-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

line-length-stream

A transform stream that returns the length of each line and the amount of indentation.

const lineLengthStream = require('line-length-stream')
let s = lineLengthStream({tabSize: 4})

s.on('data', console.log)
s.end([
	'\tfoo',
	'',
	'  bar baz'
].join('\n'))
// `[4, 3]`, `[0, 0]` and `[2, 7]` will be logged.

build status dependency status dev dependency status ISC-licensed

Installing

npm install line-length-stream

Usage

lineLengthStream takes accepts an optional options argument. It returns a transform stream. options can have the following properties.

  • tabSize: The number of chars that '\t' stands for.

Contributing

If you have a question, found a bug or want to propose a feature, have a look at the issues page.