Acrool Icon Symbols
Merge svg into svg symbols, and unpack svg symbols into individual svg
Features
- Merge svg into svg symbols
- unpack svg symbols into individual svg
- Parse SVG content
Install
yarn add @acrool/icon-symbols
Use
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,
});
Document
License
MIT Š Acrool & Imagine