Skip to content

Commit

Permalink
Add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-snezhko committed Jul 29, 2024
1 parent 5cbc298 commit c0eaaa3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
5 changes: 4 additions & 1 deletion stdlib/fs.gr
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/**
* High-level file system interactions. Utilizes WASI Preview 1 for underlying API
* Utilities for high-level file system interactions. Utilizes WASI Preview 1 for underlying API
*
* @example from "fs" include Fs
* @example Fs.Utf8.readFile(Path.fromString("baz.txt"))
* @example Fs.Utf8.writeFile(Path.fromString("baz.txt"), "Hello World\n")
* @example Fs.copy(Path.fromString("foo.txt"), Path.fromString("foocopy.txt"))
*
* @since v0.6.5
*/
Expand Down
14 changes: 13 additions & 1 deletion stdlib/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Fs
---

High-level file system interactions. Utilizes WASI Preview 1 for underlying API
Utilities for high-level file system interactions. Utilizes WASI Preview 1 for underlying API

<details disabled>
<summary tabindex="-1">Added in <code>next</code></summary>
Expand All @@ -13,6 +13,18 @@ No other changes yet.
from "fs" include Fs
```

```grain
Fs.Utf8.readFile(Path.fromString("baz.txt"))
```

```grain
Fs.Utf8.writeFile(Path.fromString("baz.txt"), "Hello World\n")
```

```grain
Fs.copy(Path.fromString("foo.txt"), Path.fromString("foocopy.txt"))
```

## Types

Type declarations included in the Fs module.
Expand Down

0 comments on commit c0eaaa3

Please sign in to comment.