line-source

It returns a source for a line of text.

Usage no npm install needed!

<script type="module">
  import lineSource from 'https://cdn.skypack.dev/line-source';
</script>

README

line-source

js-standard-style

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.