Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Last active August 31, 2021 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/a35a620f6aba958b37eb0b47d7205b66 to your computer and use it in GitHub Desktop.
Save parzibyte/a35a620f6aba958b37eb0b47d7205b66 to your computer and use it in GitHub Desktop.
const guardarArchivoDeTexto = (contenido, nombre) => {
const a = document.createElement("a");
const archivo = new Blob([contenido], { type: 'text/plain' });
const url = URL.createObjectURL(archivo);
a.href = url;
a.download = nombre;
a.click();
URL.revokeObjectURL(url);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment