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

svgicons2svgfont

Package Overview
Dependencies
Maintainers
4
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svgicons2svgfont

Read a set of SVG icons and ouput a SVG font

  • 9.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
246K
increased by5.61%
Maintainers
4
Weekly downloads
 
Created

What is svgicons2svgfont?

The svgicons2svgfont npm package is a tool that converts a set of SVG icons into a single SVG font. This is useful for creating icon fonts that can be used in web development, allowing for scalable and customizable icons.

What are svgicons2svgfont's main functionalities?

Convert SVG icons to SVG font

This feature allows you to convert a directory of SVG icons into a single SVG font file. The code sample demonstrates how to read SVG files from a directory, create a font stream, and write the resulting SVG font to a file.

const fs = require('fs');
const SVGIcons2SVGFontStream = require('svgicons2svgfont');

const fontStream = new SVGIcons2SVGFontStream({
  fontName: 'myfont'
});

fontStream.pipe(fs.createWriteStream('myfont.svg'))
  .on('finish', () => {
    console.log('Font successfully created!');
  })
  .on('error', (err) => {
    console.error(err);
  });

fs.readdirSync('icons').forEach(file => {
  const glyph = fs.createReadStream(`icons/${file}`);
  glyph.metadata = { unicode: [String.fromCharCode(0xe001 + i)], name: file.replace('.svg', '') };
  fontStream.write(glyph);
});

fontStream.end();

Other packages similar to svgicons2svgfont

Keywords

FAQs

Package last updated on 02 Jun 2018

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