Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
c4spar committed Nov 1, 2021
1 parent 60ab69c commit 215059f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,16 @@ notes.
- **io:** Deno's `std/io` module.

```ts
const data = await io.readAll(Deno.stdin);
const fileReader = await Deno.open("./example.txt");
for await (let line of io.readLines(fileReader)) {
console.log(line);
}
```

- **streams:** Deno's `std/streams` module.

```ts
const data = await streams.readAll(Deno.stdin);
```

- **fs:** Deno's `std/fs` module.
Expand Down
8 changes: 0 additions & 8 deletions examples/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,3 @@ const importMetaUrl = "file:///<redacted>/dzx/examples/markdown.md";
// const importMetaUrl = "file:///home/user/code/example.md";
console.log({ importMetaUrl });
```

Note that when executed, the path to the compiled script temp file will be
printed to the console, so you can always review what `Deno` executed if
something goes wrong. The message will look like:

```
Markdown module saved to /tmp/dzx_e2d2e74f_module.ts
```
2 changes: 1 addition & 1 deletion src/cli/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export function dzx() {
);

async function importFromStdin(): Promise<void> {
const data = new TextDecoder().decode(await io.readAll(Deno.stdin));
const data = new TextDecoder().decode(await streams.readAll(Deno.stdin));
if (data) {
$.mainModule = `data:application/typescript,${encodeURIComponent(data)}`;
await import($.mainModule);
Expand Down

0 comments on commit 215059f

Please sign in to comment.