cloudjson is a simple module that allows you to programmatically post/get/update json data online, using the api of a free service called MyJson.
Why would I need this?
This module is useful if you need to quickly store json data online, for a proof of concept project, or any not so long term project that must be done fast.
const cloudJson = ;var jsonData = 'foo' : 'bar' 'foo2' : 'bar2';// post json online (will return the url from which you'll be able to fetch your data)cloudjson;// optionnaly, you can specify a password to encrypt the data you push onlinevar password = 'myPassword';cloudjson;
From here, examples will be shown using async/await instead of 'then', implying that you are inside an async function, all methods can be used in both manners, since they all return a promise.
// to fetch data you've precedently posted, you need the previously given urlvar myData = await cloudjson;// if you encrypted the data when you posted it, specify its password to decrypt it:var myData = await cloudjson;
// to update data, you need the url of the previously created jsonvar updatedData = await cloudjson;// if your json was encrypted, specify the passwordvar updatedData = await cloudjson;