deno.land / std@0.173.0 / io / files.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
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
export { /** @deprecated (will be removed after 0.172.0) Import from `std/io/read_range.ts` instead */ type ByteRange, /** * @deprecated (will be removed after 0.172.0) Import from `std/io/read_range.ts` instead * * Read a range of bytes from a file or other resource that is readable and * seekable. The range start and end are inclusive of the bytes within that * range. * * ```ts * import { assertEquals } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts"; * import { readRange } from "https://deno.land/std@$STD_VERSION/io/files.ts"; * * // Read the first 10 bytes of a file * const file = await Deno.open("example.txt", { read: true }); * const bytes = await readRange(file, { start: 0, end: 9 }); * assertEquals(bytes.length, 10); * ``` */ readRange, /** * @deprecated (will be removed after 0.172.0) Import from `std/io/read_range.ts` instead * * Read a range of bytes synchronously from a file or other resource that is * readable and seekable. The range start and end are inclusive of the bytes * within that range. * * ```ts * import { assertEquals } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts"; * import { readRangeSync } from "https://deno.land/std@$STD_VERSION/io/files.ts"; * * // Read the first 10 bytes of a file * const file = Deno.openSync("example.txt", { read: true }); * const bytes = readRangeSync(file, { start: 0, end: 9 }); * assertEquals(bytes.length, 10); * ``` */ readRangeSync,} from "./read_range.ts";
std

Version Info

Tagged at
a year ago