Generates a block of text highlighting a syntax error, suitable for printing to a console.
npm install log-syntax-error
var block = logSyntaxError( code, line, column, options );
console.error( block );
code
is some source codeline
is the (one-based) line number of the errorcolumn
(optional) is the (zero-based) column number of the erroroptions
(optional)buffer
- the number of lines to include either side of the error. Defaults to2
.
MIT.