8000 GitHub - acrool/acrool-icon-symbols: icon svg symbol
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

acrool/acrool-icon-symbols

Repository files navigation

Acrool Icon Symbols

Acrool Icon Symbols Logo

Merge svg into svg symbols, and unpack svg symbols into individual svg

NPM npm npm

npm downloads npm

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,
});

CLI Tools

License

MIT © Acrool & Imagine

About

icon svg symbol

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published
0