raso
<h1 align="center"> <img width="100%" src="assets/raso_main.PNG" alt="raso"> </h1>
Last updated 3 years ago by everdrone .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install raso 
SYNC missed versions from official npm registry.

raso

Raso (WARNING: work in progress!)

pretty logging utility

Install

$ npm install --save-dev raso

Usage

const Raso = require('raso');

let err = new Raso('../src/excerpt.ts', 285, [29, 42]);

console.log(err.toString());
/**
 * excerpt.ts
 * 283 : if (this._options.enumerate == true) {
 * 284 :   enumer = addZero(this._source[n].line, maxNum);
 * 285>:   enumer2 = _.defaults(this._options.replacers.postLineNumber, '');
 *                              ^^^^^^^^^^^^^
 */

API

Raso(path, line[, column][, options])

Parameters:

  • path: {string} - path to the source file.
  • line: {number} - the line number to highlight
  • [column]: {number | number[]} - the column to highlight.
    • if no column is specified, raso will mark just the line.
    • if column is an array of numbers, column[0] and column[1] will be interpreted as a range to highlight.
  • [options]: {object} - sets the appearance of the logger, see Options

Raso().toString()

Returns:

  • {string} - the output string.

options: {object}

  • position: {string} - determines where raso should indicate the referenced line (both: gutter and underline, aside: gutter only, under: underline only)
  • truncate: {boolean} - if true, the output will be truncated according to the terminal column count.
  • enumerate: {boolean} - if true line numbers and gutter will print.
  • fileName: {boolean} - if true the source file name will be printed above the code.
  • around: {object}
    • lines: {number} - the number of lines to print before and after the highlighted line.
    • ahead: {boolean} - if false lines ahead the referenced line will not print.
  • glyps: {object}
    • postLineNumber: {string}
    • gutterIndicator: {string}
    • rangeIndicator: {string}
    • singleIndicator: {string}
  • padding: {object}
    • top: {boolean}
    • bottom: {boolean}
    • left: {number}
  • style: {object}
    • main: {string}
    • focus: {string}
    • lineNumber: {string}
    • filename: {string}

Maintainers

License

MIT

Current Tags

  • 1.1.1                                ...           latest (3 years ago)

8 Versions

  • 1.1.1                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.13                                ...           3 years ago
  • 1.0.12                                ...           3 years ago
  • 1.0.11                                ...           3 years ago
  • 1.0.10                                ...           3 years ago
  • 1.0.9                                ...           3 years ago
  • 1.0.8                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 17
Last Day 0
Last Week 8
Last Month 1
Dependencies (10)
Dev Dependencies (9)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |