I want to export a few items from my localStorage to save it externally but in a format so that I can import it again later.
My attempt was to write executable code that
Here's how to import/export your entire localStorage
Export
copy(JSON.stringify(localStorage));
This will copy your localStorage to your clipboard. (You need two JSON.stringify()'s to get the quotes escaped.)
Import
var data = JSON.parse(/*paste stringified JSON from clipboard*/);
Object.keys(data).forEach(function (k) {
localStorage.setItem(k, data[k]);
});