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

Conversation

caspervonb
Copy link
Contributor

This removes writeJson and writeJsonSync from std/fs entirely as they are fairly peculiar functions and the only ones in the std/fs namespace that deals with file output and they only deal with writing JSON from a text file which is very specialized.

The same can be achieved quite easily with await Deno.writeTextFile(JSON.stringify(object))and Deno.writeTextFileSync(JSON.stringify(object)).

@caspervonb
Copy link
Contributor Author

See also #7255.

Split them for cleaner changelogs.

@caspervonb caspervonb force-pushed the breaking-std-fs-remove-write-json branch from 93c2249 to 84642a3 Compare August 29, 2020 17:12
@nayeemrmn
Copy link
Collaborator

#6848 (review) 🙃

@lcswillems
Copy link

I was happily using them in my code! I think these functions are a nice addition to Deno. JSON is a very common file type especially in JS/TS projects. Moreover, if the same can be achieved easily with a longer code, it is an argument to keep it in Deno because it is easy to main + it makes people's life easier for handling JSON files.

@bartlomieju
Copy link
Member

See #7255 (comment)

@bartlomieju bartlomieju added this to the 1.4.0 milestone Sep 6, 2020
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @caspervonb

@bartlomieju bartlomieju merged commit 334ed0e into denoland:master Sep 7, 2020
@VienDinhCom
Copy link

VienDinhCom commented Oct 6, 2020

I have ported the readJson, readJsonSync, writeJson & writeJsonSync into this module: https://deno.land/x/jsonfile

caspervonb added a commit to caspervonb/deno_std that referenced this pull request Jan 21, 2021
caspervonb added a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb added a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb added a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb added a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb added a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb added a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb added a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb added a commit to caspervonb/deno_std that referenced this pull request Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants