-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdeps.ts
70 lines (56 loc) · 1.74 KB
/
deps.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// std/
export {
basename,
dirname,
fromFileUrl,
join,
resolve,
} from "https://deno.land/std@0.164.0/path/mod.ts";
// std/node/
export { Buffer } from "https://deno.land/std@0.166.0/node/buffer.ts";
// x/
export { getWords } from "https://deno.land/x/dryptography@v0.1.4/aes/utils/words.ts";
// cdn.skypack.dev/
export {
Mutex,
Semaphore,
} from "https://cdn.skypack.dev/async-mutex@v0.4.0?dts";
export {
default as AES,
IGE,
} from "https://cdn.skypack.dev/@cryptography/aes@0.1.1?dts";
export { inflate } from "https://cdn.skypack.dev/pako@v2.1.0?dts";
export { getExtension, getType } from "https://cdn.skypack.dev/mime?dts";
export { default as bigInt } from "https://cdn.skypack.dev/big-integer?dts";
// ghc.deno.dev/
export {
type Handler,
Parser,
} from "https://ghc.deno.dev/tbjgolden/deno-htmlparser2@1f76cdf/htmlparser2/Parser.ts";
import { type Socket as Socket_ } from "https://deno.land/std@0.166.0/node/net.ts";
export let Socket = null as unknown as typeof Socket_;
if (typeof document === "undefined") {
Socket = (await import("https://deno.land/std@0.166.0/node/net.ts")).Socket;
}
import { type SocksClient as SocksClient_ } from "https://deno.land/x/deno_socks@v2.6.1/mod.ts";
export let SocksClient = null as unknown as typeof SocksClient_;
if (typeof document === "undefined") {
SocksClient =
(await import("https://deno.land/x/deno_socks@v2.6.1/mod.ts")).SocksClient;
}
export class WriteStream {
constructor(public path: string, public file: Deno.FsFile) {
}
write(p: Uint8Array) {
return this.file.write(p);
}
close() {
this.file.close();
}
}
export function createWriteStream(path: string) {
return new WriteStream(
path,
Deno.openSync(path, { write: true, create: true }),
);
}