acrool-icon-symbols
v1.3.5
Published
Common tools and methods for project development
Downloads
107
Maintainers
Readme
Acrool Icon Symbols
Features
- Merge svg into svg symbols
- unpack svg symbols into individual svg
- Parse SVG content
Install
yarn add -D 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,
});