-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
BREAKING(std/fs): remove writeJson and writeJsonSync #7256
Conversation
See also #7255. Split them for cleaner changelogs. |
93c2249
to
84642a3
Compare
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. |
See #7255 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @caspervonb
I have ported the |
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))
andDeno.writeTextFileSync(JSON.stringify(object))
.