How to use the cspell-io.readFile function in cspell-io

To help you get started, we’ve selected a few cspell-io examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github streetsidesoftware / cspell / packages / cspell-lib / src / util / fileReader.ts View on Github external
export async function readLines(filename: string, encoding: BufferEncoding = 'utf8') {
    try {

        const content = await readFile(filename, encoding);
        return toIterableIterator(content.split(/\r?\n/g));
    } catch (e) {
        return Promise.reject(e);
    }
}

cspell-io

A library of useful I/O functions used across various cspell tools.

MIT
Latest version published 6 days ago

Package Health Score

89 / 100
Full package analysis