Socket
Socket
Sign inDemoInstall

postcss-base64

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-base64 - npm Package Compare versions

Comparing version 0.1.3 to 0.2.0

14

index.js

@@ -5,6 +5,14 @@ var postcss = require('postcss');

return function (css, result) {
opts = opts || { debug: false };
var output;
opts = opts || {
debug: false,
pattern: '<svg.*<\/svg>'
};
css.replaceValues(/<svg.*<\/svg>/, { fast: '<svg' }, function (string) {
var output, search;
if(!opts.pattern) throw new Error('No search pattern given.');
search = new RegExp(opts.pattern);
css.replaceValues(search, function (string) {
output = 'data:image/svg+xml;base64,' + new Buffer(string).toString('base64');

@@ -11,0 +19,0 @@ if(opts.debug) {

{
"name": "postcss-base64",
"version": "0.1.3",
"version": "0.2.0",
"description": "Replace *inline* SVG images in url() statements with base64 encoded strings.",

@@ -5,0 +5,0 @@ "author": "Jelmer de Maat",

@@ -8,3 +8,4 @@ var fs = require('fs'),

var opts = {
debug: false
debug: true,
pattern: '<svg.*<\/svg>'
};

@@ -11,0 +12,0 @@

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