Skip to content

A faster version for the readable's implementation of Symbol.asyncIterator

License

Notifications You must be signed in to change notification settings

Farenheith/faster-readline-iterator

Repository files navigation

test-coverage test

faster-readable-iterator

A faster version for the readline's implementation of Symbol.asyncIterator. With this version, you can achieve a performance 20% to 58% better than with the vanilla one.

how to install

npm i faster-readable-iterator

how to use it

Just get your readline interface:

import { createInterface } from 'readline';
import { getReadlineIterable } from 'faster-readline-iterator';

const interfaceInstance = createInterface({
    input: getLoremIpsumStream(),
});

Then get your iterable from it using getReadlineIterable:

const iterable = getReadlineIterable(interfaceInstance);

for await (const line of iterable) {
    console.log(line);
}

About

A faster version for the readable's implementation of Symbol.asyncIterator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published