Skip to content

Commit

Permalink
BREAKING(fs): remove writeJson and writeJsonSync (denoland/deno#7256)
Browse files Browse the repository at this point in the history
  • Loading branch information
caspervonb authored and denobot committed Jan 31, 2021
1 parent 943df5b commit ce15fde
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 283 deletions.
24 changes: 0 additions & 24 deletions fs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,30 +118,6 @@ copySync("./foo", "./existingFolder", { overwrite: true });
// Will overwrite existingFolder
```

### writeJson

Writes an object to a JSON file.

#### WriteJsonOptions

- replacer : An array of strings and numbers that acts as a approved list for
selecting the object properties that will be stringified.
- space : Adds indentation, white space, and line break characters to the
return-value JSON text to make it easier to read.

You can also specify options from `Deno.WriteFileOptions` to configure how the
file is written.

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

writeJson("./target.dat", { foo: "bar" }, { spaces: 2 }); // returns a promise
writeJsonSync("./target.dat", { foo: "bar" }, { replacer: ["foo"] }); // void

// appends to the file instead of rewriting
writeJsonSync("./target.dat", { foo: "bar" }, { append: true });
```

### walk

Iterate all files in a directory recursively.
Expand Down
1 change: 0 additions & 1 deletion fs/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ export * from "./exists.ts";
export * from "./expand_glob.ts";
export * from "./move.ts";
export * from "./copy.ts";
export * from "./write_json.ts";
export * from "./walk.ts";
export * from "./eol.ts";
57 changes: 0 additions & 57 deletions fs/write_json.ts

This file was deleted.

201 changes: 0 additions & 201 deletions fs/write_json_test.ts

This file was deleted.

0 comments on commit ce15fde

Please sign in to comment.