0.3.9 • Published 2 years ago

newline-iterator v0.3.9

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

newline-iterator

Line-by-line string iterator

Example 1

import newlineIterator from 'newline-iterator';

const iterator = newlineIterator('some\r\nstring\ncombination\r');
const results = [];
for (const line of iterator) results.push(line);
console.log(results); // ["some", "string", "combination"];

Example 2

import newlineIterator from 'newline-iterator';

const iterator = newlineIterator('some\r\nstring\ncombination\r');
console.log(iterator.next()); // { value: "some", done: false }
console.log(iterator.next()); // { value: "srting", done: false }
console.log(iterator.next()); // { value: "combination", done: false }
console.log(iterator.next()); // { value: undefined, done: true }

Documentation

API Docs

0.3.9

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.0

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago