Saving files to cloud storage from memory

Eg saving a json
docs
const bucket = admin.storage().bucket(testEnv.storageBucket);
const file = bucket.file(mockObject.name);
const contents = JSON.stringify(mockObject, null, 2);
​
file.save(contents, function(err) {
if (!err) {
// file written
}
});
​