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

mini-svg-data-uri

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mini-svg-data-uri

Small, efficient encoding of SVG data URIs for CSS, HTML, etc.

  • 1.4.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.4M
decreased by-39.04%
Maintainers
1
Weekly downloads
 
Created

What is mini-svg-data-uri?

The mini-svg-data-uri package is designed to convert SVG files into the most compact, URL-encodeable form. This is particularly useful for embedding SVG directly into web pages or CSS files without the need for additional HTTP requests. The package optimizes the SVG content for size and compatibility, making it an efficient choice for web developers looking to improve performance and reduce load times.

What are mini-svg-data-uri's main functionalities?

Convert SVG to Data URI

This feature allows you to convert an SVG string into a compact, URL-encodeable data URI. The code sample demonstrates how to use the package to convert a simple SVG circle into a data URI that can be embedded directly into HTML or CSS.

const svgToDataUri = require('mini-svg-data-uri');
const svg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" /></svg>';
const dataUri = svgToDataUri(svg);
console.log(dataUri);

Other packages similar to mini-svg-data-uri

Keywords

FAQs

Package last updated on 14 Oct 2021

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