Skip to content

Commit

Permalink
docs(fs): provide more context on unstable perm (denoland/deno#6748)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmj7 authored and caspervonb committed Jan 31, 2021
1 parent 79e1c5c commit 58bfb40
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions fs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ fs module is made to provide helpers to manipulate the filesystem.

## Usage

All the following modules are exposed in `mod.ts` This feature is currently
unstable. To enable it use `deno run --unstable`
Most the following modules are exposed in `mod.ts` This feature is currently
<b>unstable</b>. To enable it use `deno run --unstable`

### emptyDir

Expand Down Expand Up @@ -174,6 +174,37 @@ async function printFilesNames() {
printFilesNames().then(() => console.log("Done!"));
```

### readFileStr

Read file and output it as a string. Note: this module does not require the
`--unstable` flag.

**ReadOptions**

- encoding : The encoding to read file. lowercased.

```ts
import { readFileStr, readFileStrSync } from "https://deno.land/std/fs/mod.ts";

readFileStr("./target.dat", { encoding: "utf8" }); // returns a promise
readFileStrSync("./target.dat", { encoding: "utf8" }); // string
```

### writeFileStr

Write the string to file. Note: this module does not require the `--unstable`
flag.

```ts
import {
writeFileStr,
writeFileStrSync,
} from "https://deno.land/std/fs/mod.ts";

writeFileStr("./target.dat", "file content"); // returns a promise
writeFileStrSync("./target.dat", "file content"); // void
```

### expandGlob

Expand the glob string from the specified `root` directory and yield each result
Expand Down

0 comments on commit 58bfb40

Please sign in to comment.