0.1.1 • Published 9 years ago

log-syntax-error v0.1.1

Weekly downloads
157
License
MIT
Repository
-
Last release
9 years ago

log-syntax-error

Generates a block of text highlighting a syntax error, suitable for printing to a console.

Installation

npm install log-syntax-error

Usage

var block = logSyntaxError( code, line, column, options );
console.error( block );
  • code is some source code
  • line is the (one-based) line number of the error
  • column (optional) is the (zero-based) column number of the error
  • options (optional)
    • buffer - the number of lines to include either side of the error. Defaults to 2.

License

MIT.