Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svgfont2svgicons

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svgfont2svgicons

Extract SVG icons from an SVG font

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

svgfont2svgicons

Extract SVG icons from an SVG font

GitHub license

Usage

In your scripts

import svgfont2svgicons from 'svgfont2svgicons';
import fs from 'node:fs';

const fontStream = fs.createReadStream('myFont.svg');
const iconProvider = svgfont2svgicons(options);

// Piping the font
fontStream.pipe(iconProvider);

// Saving the SVG files
iconProvider.on('readable', function() {
  let icon;

do {
    icon = iconProvider.read();
    if(icon) {
      console.log('New icon:', icon.metadata.name, icon.metadata.unicode);
      icon.pipe(fs.createWriteStream(icon.metadata.name + '.svg'));
    }
  } while(null !== icon);
}).once('end', function() {
  console.log('No more icons!')
});

CLI interface

svgfont2svgicons font/src/file.svg icons/dest/directory

Options

Currently no options, feel free to suggest some in the issues.

Contributing

Feel free to pull your code if you agree with publishing under the MIT license.

Authors

License

MIT

Keywords

FAQs

Package last updated on 12 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc