0.1.1 • Published 10 years ago

riline v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

Riline.js

Utility for logging lines of code from a text string (or file).

Build Status

Hot to use

Initialized riline object constructor gets text string as a parameter, then you can log parts of this text string in a console with some warning messages.

Riline = require('../src/riline')
fs = require 'fs'

text = fs.readFileSync('./my_text_file.txt').toString()
riline = new Riline(text)

riline.addMessage
  type: 'warning'
  startLine: 10
  endLine: 15
  message: 'Somethin is wrong in this lines'

riline.addMessage
  type: 'warning'
  startLine: 50
  message: 'This will highlight only one line'

# it will print all added messages in console with related pieces of text
riline.printMessages()