I build app that will present a lot of icons so I need list of all Font-Awesome class name like
[\"fa-dropbox\",\"fa-rocket\",\"fa-globe\", ....]
so on is ther
Another little script for posterity.
Update 02/2018 (version 5.x)
Latest working version, based on edit from Blasius Secondus (thanks).
Open the fonts cheat sheet and run the following snippet in the developper console: https://fontawesome.com/cheatsheet
var names = new Set();
var icons = document.getElementsByClassName('icon');
for (const icon of icons) {
const name = icon.getElementsByTagName('dd')[0].innerText;
names.add(name);
}
console.log(JSON.stringify(Array.from(names)));
If you want them sorted by section (solid/regular/brand):
var groups = {};
var sections = document.getElementsByClassName('cheatsheet-set');
for (const section of sections) {
const names = [];
groups[section.id] = names;
var icons = section.getElementsByClassName('icon');
for (const icon of icons) {
const name = icon.getElementsByTagName('dd')[0].innerText;
names.push(name);
}
}
console.log(groups); // Feel free to stringify/manipulate
Original answer
Simply open the latest cheatsheet: http://fortawesome.github.io/Font-Awesome/cheatsheet/
Then in your browser, open the developer console and run:
var names = [];
$('.row .col-md-4').each(function() {
var s = $(this).text();
var m = s.match(/fa-.*/);
if (m && m[0] && s.indexOf('(alias)') < 0) {
names.push(m[0]);
}
});
console.log( JSON.stringify( names ) );
If you want the list instead of an array, replace the last line by
console.log( names.join(' ') );
(You can use any separator you want instead of space ' ')
The advantage of this method is that you will only get the visual icons (not the fa-spin and friends), and not the duplicate aliases.