mirror of
https://github.com/simple-icons/simple-icons.git
synced 2024-11-26 01:00:27 +02:00
ca0e2ac72e
make is possible to import all icons with the SVG content, see example.js for usage Discussion at https://github.com/simple-icons/simple-icons/pull/446
14 lines
319 B
JavaScript
14 lines
319 B
JavaScript
const dataFile = './_data/simple-icons.json';
|
|
const data = require(dataFile);
|
|
const fs = require('fs');
|
|
|
|
let Icons = {};
|
|
|
|
data.icons.forEach(i => {
|
|
i.name = i.title.toLowerCase().replace(/[^a-z0-9]/gim, '');
|
|
i.svg = fs.readFileSync(`./icons/${i.name}.svg`, 'utf8');
|
|
Icons[i.name] = i
|
|
});
|
|
|
|
module.exports = Icons;
|