context-lines
v0.1.1
Published
Returns an object with start- and endpoints for showing context around an error containing line.
Readme
Install
npm install context-lines --saveBasic usage
var contextLines = require('context-lines');
var context = contextLines(5);
/* {
endIndex: 7,
endLine: 8,
errIndex: 4,
errLine: 5,
lineCount: 7,
startIndex: 1,
startLine: 2
} */