1
0
mirror of https://github.com/simple-icons/simple-icons.git synced 2024-11-26 01:00:27 +02:00
simple-icons/index.js

16 lines
375 B
JavaScript
Raw Normal View History

const dataFile = './_data/simple-icons.json';
const data = require(dataFile);
const fs = require('fs');
const icons = {};
data.icons.forEach(i => {
const filename = i.title.toLowerCase()
.replace(/\+/g, "plus")
.replace(/[ .\-!’]/g, '');
2017-09-17 04:46:33 +02:00
i.svg = fs.readFileSync(`${__dirname}/icons/${filename}.svg`, 'utf8');
icons[i.title] = i
});
module.exports = icons;