Socket
Socket
Sign inDemoInstall

postcss-image-inliner

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-image-inliner - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

13

CHANGELOG.md
v0.3.1 / 2016-05-10
===================
* travis tweaks
* bump deps & eslint-config
* added glob tests
v0.3.0 / 2016-02-05
===================
* handle content property (#61)
* bump deps
0.2.0 / 2015-12-10

@@ -3,0 +16,0 @@ ==================

10

index.js

@@ -14,8 +14,7 @@ var postcss = require('postcss');

module.exports = postcss.plugin('postcss-image-inliner', function (opts) {
opts = defaults(opts || {}, {
assetPaths: [],
assetPaths: [],
maxFileSize: 10240,
b64Svg: false,
strict: false
b64Svg: false,
strict: false
});

@@ -29,3 +28,2 @@

function assertSize(resource) {

@@ -45,3 +43,3 @@ var encoding = resource.mime === 'image/svg+xml' ? 'utf-8' : 'binary';

return getResource(filepath, {
base: opts.assetPaths,
base: opts.assetPaths,
filter: assertSize

@@ -48,0 +46,0 @@ }).catch(function (err) {

9

lib/image.js

@@ -15,3 +15,3 @@ var debug = require('debug')('image-inliner');

// strip comments
.replace(/<\!\-\-(.*(?=\-\->))\-\->/gmi, '')
.replace(/<!\-\-(.*(?=\-\->))\-\->/gmi, '')
// replace

@@ -39,3 +39,3 @@ .replace(/'/gmi, '\\i'))

data: 'data:image/svg+xml;charset=US-ASCII,' + encodeSvg(file),
key: key
key: key
});

@@ -49,3 +49,3 @@ });

data: 'data:' + file.mime + ';base64,' + new Buffer(file.contents, 'binary').toString('base64'),
key: key
key: key
};

@@ -55,3 +55,2 @@ };

function getDataUri(res, opts) {

@@ -64,6 +63,4 @@ var promises = map(res, computeDataUri(opts));

}, {});
}
module.exports.getDataUri = getDataUri;
{
"name": "postcss-image-inliner",
"version": "0.3.0",
"version": "0.3.1",
"description": "PostCSS plugin to inline images into css",

@@ -24,6 +24,6 @@ "keywords": [

"dependencies": {
"asset-resolver": "0.1.1",
"bluebird": "3.2.1",
"asset-resolver": "0.2.1",
"bluebird": "3.3.5",
"debug": "2.2.0",
"filesize": "3.2.1",
"filesize": "3.3.0",
"lodash.defaults": "^4.0.0",

@@ -40,12 +40,13 @@ "lodash.escaperegexp": "^4.0.0",

"object-hash": "^1.1.0",
"postcss": "5.0.14",
"request": "2.67.0",
"svgo": "0.6.1",
"postcss": "5.0.21",
"request": "2.72.0",
"svgo": "0.6.6",
"then-fs": "2.0.0"
},
"devDependencies": {
"chai": "3.4.1",
"chai": "3.5.0",
"eslint-config-xo": "^0.14.1",
"finalhandler": "0.4.1",
"gulp": "3.9.0",
"gulp-eslint": "1.1.1",
"gulp": "3.9.1",
"gulp-eslint": "2.0.0",
"gulp-mocha": "2.2.0",

@@ -52,0 +53,0 @@ "serve-static": "1.10.2"

@@ -42,7 +42,7 @@ # PostCSS Image Inliner [![Build Status][ci-img]][ci]

Default: `[process.cwd()]`
Example: `['http://domain.de/', 'http://domain.de/styles', 'app/images']`
Example: `['http://domain.de/', 'http://domain.de/styles', 'app/images', '**/images/']`
Required: `false`
List of directories/urls where the inliner should start looking for assets.
You can define local directories or URLs.
You can define local directories (globs supported) or URLs.

@@ -49,0 +49,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