Socket
Socket
Sign inDemoInstall

css-b64-images

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-b64-images - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

.travis.yml

17

lib/css-b64-images.js

@@ -6,3 +6,16 @@ var fs = require('fs'),

absoluteUrlRegex = /^\//,
externalUrlRegex = /http/;
externalUrlRegex = /http/,
mediatypes = {
'eot' : 'application/vnd.ms-fontobject',
'gif' : 'image/gif',
'ico' : 'image/vnd.microsoft.icon',
'jpg' : 'image/jpeg',
'jpeg' : 'image/jpeg',
'otf' : 'application/x-font-opentype',
'png' : 'image/png',
'svg' : 'image/svg+xml',
'ttf' : 'application/x-font-ttf',
'webp' : 'image/webp',
'woff' : 'application/x-font-woff'
};

@@ -61,3 +74,3 @@ module.exports = {

var ext = imagePath.substr(imagePath.lastIndexOf('.') + 1);
var newCss = css.replace(imageUrl, 'data:image/' + ext + ';base64,' + img);
var newCss = css.replace(imageUrl, 'data:' + mediatypes[ext] + ';base64,' + img);
cb(null, newCss);

@@ -64,0 +77,0 @@ });

2

package.json

@@ -5,3 +5,3 @@ {

"description": "Base64 images in your css",
"version": "0.2.1",
"version": "0.2.2",
"main": "lib/css-b64-images.js",

@@ -8,0 +8,0 @@ "bin": "bin/css-b64-images",

@@ -0,1 +1,2 @@

[![build status](https://secure.travis-ci.org/Filirom1/css-base64-images.png)](http://travis-ci.org/Filirom1/css-base64-images)
css-base64-images

@@ -2,0 +3,0 @@ =================

@@ -36,2 +36,4 @@ var Path = require('path'),

css.should.include(".not-found {\n background: url('../img");
css.should.include(".mediatype {\n background: url('data:image/svg+xml;base64,");
}

Sorry, the diff of this file is not supported yet

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