Skip to content

Instantly share code, notes, and snippets.

@nikolaskhodov
Last active November 3, 2020 10:13
Show Gist options
  • Select an option

  • Save nikolaskhodov/e305440f2963beac60a8443e64cf101c to your computer and use it in GitHub Desktop.

Select an option

Save nikolaskhodov/e305440f2963beac60a8443e64cf101c to your computer and use it in GitHub Desktop.
(function() {
const serializedLS = JSON.stringify(localStorage);
const template = `Object.entries(${serializedLS}).forEach((key, value) => localStorage.setItem(key, value))`;
copy(template);
console.log(`${template.length} bytes copies to the clipboard!`);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment