Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/capi/deps/std/io.ts>readStringDelim

[WIP] A framework for crafting interactions with Substrate chains
Latest
function readStringDelim
import { readStringDelim } from "https://deno.land/x/capi@v0.1.1-beta.1/deps/std/io.ts";

Read Reader chunk by chunk, splitting based on delimiter.

Examples

Example 1

import { readStringDelim } from "https://deno.land/std@0.224.0/io/read_string_delim.ts";
import * as path from "https://deno.land/std@0.224.0/path/mod.ts";

const filename = path.join(Deno.cwd(), "std/io/README.md");
let fileReader = await Deno.open(filename);

for await (let line of readStringDelim(fileReader, "\n")) {
  console.log(line);
}

Parameters

reader: Reader
delim: string
optional
decoderOpts: { encoding?: string; fatal?: boolean; ignoreBOM?: boolean; }

Returns

AsyncIterableIterator<string>