Last active
November 21, 2020 16:39
-
-
Save surajitbasak109/69b92aced915682db76239735a5238a9 to your computer and use it in GitHub Desktop.
Download all font awesome icons as JSON format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Follow This link first: | |
* https://fontawesome.com/cheatsheet | |
* Then enter following code in console panel | |
* will show a download dialog to download as json format | |
* :) :) :) | |
*/ | |
(function () { | |
let icons = document.querySelectorAll('.icon'); | |
let data = Array.from(icons).map(icon => { | |
return { | |
name: icon.querySelector('.icon-name').textContent, | |
unicode: icon.querySelector('.icon-unicode').textContent, | |
}; | |
}); | |
const blob = new Blob([JSON.stringify(data, null, 2)], {type: 'application/json'}); | |
const url = URL.createObjectURL(blob); | |
const link = document.createElement('a'); | |
link.href = url; | |
link.download = "font-awesome-db"; | |
document.body.appendChild(link); | |
link.click(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment