Have Loader save JSON and Text

Had a request on Discord from Storydweller to have the Loader save JSON (as it can load JSON). So we put that in place and it is patched in ZIM 016.

// save a json file
const obj = {a:[1,2,3], b:"hello"};
new Loader().save({content:obj, type:"json"}); 
// save a text file
const textInput = new TextInput().center();
new Button({label:"SUBMIT", wait:"SAVED"})
	.center()
	.mov(0,100)
	.tap(()=>{
		new Loader().save({
			content:textInput.text, 
			filename:"answer.txt", 
			type:"text"
		});
	});
2 Likes