line-source
v0.2.7
Published
It returns a source for a line of text.
Downloads
46
Readme
line-source
What is it?
It returns a source for a line of text.
const LineSource = require('line-source')
const l = new LineSource('foo bar quux')
l.currentChar // => 'f'
l.position // => 1
l.peekChar() // => 'o'
l.nextChar() // => 'o'
// All methods and properties return `null' once the
// currentChar has moved past the end of the source
// string.
//
// An error is thrown if the input string contains
// unescaped newline characters (`\n`).
How do I work on it?
development
git clone https://github.com/sterpe/line-source.git
cd line-source
make
build
make build
test
make JEST_FLAGS=--coverage test
lint
make lint
Consult the Makefile
for further details.