A small module to write JSON files.
If you want to read JSON files, check out
# Using npmnpm install --save w-json# Using yarnyarn add w-json
// Dependenciesvar WriteJson = ;// Write the same file synchronously;// 4 space indent and new line at the end;// Write test.json asynchronously;
❓ Get Help
There are few ways to get help:
- Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.
- For bug reports and feature requests, open issues. 🐛
- For direct and quick help, you can use Codementor. 🚀
wJson(path, data, options, callback)
Writes a JSON file.
path: The JSON file path.
data: The JSON data to write in the provided file.
options: An object containing the fields below. If boolean, it will be handled as
new_line, if number it will be handled as
space(Number): An optional space value for beautifying the json output (default:
true, a new line character will be added at the end of the stringified content.
callback: An optional callback. If not passed, the function will run in sync mode.
😋 How to contribute
Have an idea? Found a bug? See how to contribute.
💖 Support my projects
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
Starring and sharing the projects you like 🚀
Bitcoin—You can send me bitcoins at this address (or scanning the code below):
💫 Where is this library used?
If you are using this library in one of your projects, add it in this list. ✨