UNPKG

cspell-lib

Version:

A library of useful functions used across various cspell tools.

9 lines 386 B
import { toFileURL } from 'cspell-io'; import { readTextFile } from '../fileSystem.js'; import { toIterableIterator } from './iterableIteratorLib.js'; export async function readLines(url, encoding = 'utf8') { url = toFileURL(url); const content = await readTextFile(url, encoding); return toIterableIterator(content.split(/\r?\n/g)); } //# sourceMappingURL=fileReader.js.map