mirror of
https://github.com/denoland/deno.git
synced 2024-11-01 09:24:20 -04:00
24 lines
501 B
TypeScript
24 lines
501 B
TypeScript
|
const { diagnostics, files } = await Deno.emit("/main.ts", {
|
||
|
compilerOptions: {
|
||
|
target: "esnext",
|
||
|
lib: ["esnext", "dom", "dom.iterable", "dom.asynciterable"],
|
||
|
},
|
||
|
sources: {
|
||
|
"/main.ts": `const rs = new ReadableStream<string>({
|
||
|
start(c) {
|
||
|
c.enqueue("hello");
|
||
|
c.enqueue("deno");
|
||
|
c.close();
|
||
|
}
|
||
|
});
|
||
|
|
||
|
for await (const s of rs) {
|
||
|
console.log("s");
|
||
|
}
|
||
|
`,
|
||
|
},
|
||
|
});
|
||
|
|
||
|
console.log(diagnostics);
|
||
|
console.log(Object.keys(files).sort());
|