Skip to content

Rich-Harris/log-syntax-error

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Highlight syntax error locations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published