line-length-stream

0.1.1 • Public • Published

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.

Package Sidebar

Install

npm i line-length-stream

Weekly Downloads

2

Version

0.1.1

License

ISC

Last publish

Collaborators

  • derhuerst