deno.land / std@0.167.0 / streams / delimiter.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.// This module is browser compatible.
import { TextLineStream as _TextLineStream } from "./text_line_stream.ts";import { DelimiterStream as _DelimiterStream } from "./delimiter_stream.ts";import { TextDelimiterStream as _TextDelimiterStream } from "./text_delimiter_stream.ts";
/** * @deprecated (will be removed after 0.169.0) Import from `std/streams/text_line_stream.ts` instead. * * Transform a stream into a stream where each chunk is divided by a newline, * be it `\n` or `\r\n`. `\r` can be enabled via the `allowCR` option. * * ```ts * import { TextLineStream } from "https://deno.land/std@$STD_VERSION/streams/delimiter.ts"; * const res = await fetch("https://example.com"); * const lines = res.body! * .pipeThrough(new TextDecoderStream()) * .pipeThrough(new TextLineStream()); * ``` */export const TextLineStream = _TextLineStream;
/** * @deprecated (will be removed after 0.169.0) Import from `std/streams/delimiter_stream.ts` instead. * * Transform a stream into a stream where each chunk is divided by a given delimiter. * * ```ts * import { DelimiterStream } from "https://deno.land/std@$STD_VERSION/streams/delimiter.ts"; * const res = await fetch("https://example.com"); * const parts = res.body! * .pipeThrough(new DelimiterStream(new TextEncoder().encode("foo"))) * .pipeThrough(new TextDecoderStream()); * ``` */export const DelimiterStream = _DelimiterStream;
/** * @deprecated (will be removed after 0.169.0) Import from `std/streams/delimiter_stream.ts` instead. * * Transform a stream into a stream where each chunk is divided by a given delimiter. * * ```ts * import { TextDelimiterStream } from "https://deno.land/std@$STD_VERSION/streams/delimiter.ts"; * const res = await fetch("https://example.com"); * const parts = res.body! * .pipeThrough(new TextDecoderStream()) * .pipeThrough(new TextDelimiterStream("foo")); * ``` */export const TextDelimiterStream = _TextDelimiterStream;
std

Version Info

Tagged at
a year ago