Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING(std/fs): remove writeJson and writeJsonSync #7256

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions std/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 std/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 std/fs/write_json.ts

This file was deleted.

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

This file was deleted.