Merge svg into svg symbols, and unpack svg symbols into individual svg
- Merge svg into svg symbols
- unpack svg symbols into individual svg
- Parse SVG content
yarn add -D acrool-icon-symbols
import {decodeSvgPaths, decodeSymbols} from 'acrool-icon-symbols';
const fileContent = await fs.readFileSync(filePath);
const svg = decodeSvgPaths(fileContent.toString());
const symbols = decodeSymbols(fileContent.toString());
const newId = await this.iconSymbolService.create({
code: file.filename.replace(/[ -]/g,'_').replace(/.svg$/,''),
viewBox: svg.viewBox,
content: svg.paths.join(''),
iconDepotId,
creatorId: currentMember.id,
});