log-syntax-error

0.1.1 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i log-syntax-error

Weekly Downloads

26

Version

0.1.1

License

MIT

Last publish

Collaborators

  • rich_harris