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

base64-image-loader

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base64-image-loader - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

commitlint.config.js

13

index.js

@@ -6,6 +6,11 @@ 'use strict';

function getMime(path) {
const extension = path.split('.').pop().toLowerCase();
const extension = path
.split('.')
.pop()
.toLowerCase();
const mime = mimes[extension];
if (!mime) {
throw new Error('Unsupported type of image of extension ' + extension + ': ' + path);
throw new Error(
'Unsupported type of image of extension ' + extension + ': ' + path
);
}

@@ -17,4 +22,6 @@ return mime;

this.cacheable && this.cacheable();
return `module.exports = "data:${getMime(this.resourcePath)};base64,${content.toString('base64')}"`;
return `module.exports = "data:${getMime(
this.resourcePath
)};base64,${content.toString('base64')}"`;
};
module.exports.raw = true;
{
"name": "base64-image-loader",
"version": "1.2.0",
"version": "1.2.1",
"description": "base64 image loader for webpack",

@@ -10,13 +10,18 @@ "repository": {

"scripts": {
"test": "mocha"
"test": "mocha",
"precommit": "lint-staged",
"format": "npm run staged-format \"**/*.+(js|json)\"",
"staged-format": "prettier --single-quote --write",
"commitmsg": "commitlint -e"
},
"keywords": [
"base64",
"image",
"webpack",
"loader",
"img",
"src",
"img src"
],
"keywords": ["base64", "image", "webpack", "loader", "img", "src", "img src"],
"lint-staged": {
"*.js": [
"npm run test",
"npm run staged-format",
"eslint --fix",
"git add"
],
"*.json": ["npm run staged-format", "git add"]
},
"bugs": "https://github.com/jahredhope/base64-image-loader/issues",

@@ -27,8 +32,15 @@ "main": "index.js",

"devDependencies": {
"chai": "^3.5.0",
"eslint": "^2.11.0",
"eslint-config-airbnb-base": "^3.0.1",
"eslint-plugin-import": "^1.8.1",
"mocha": "^2.5.3"
"@commitlint/cli": "^5.2.5",
"@commitlint/config-angular": "^5.1.1",
"chai": "^4.1.2",
"commitlint": "^5.2.5",
"eslint": "^4.13.0",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-import": "^2.8.0",
"husky": "^0.14.3",
"lint-staged": "^6.0.0",
"mocha": "^4.0.1",
"prettier": "1.9.1"
}
}
# base64 image loader for webpack
[![Greenkeeper badge](https://badges.greenkeeper.io/jahredhope/base64-image-loader.svg)](https://greenkeeper.io/)
![](https://travis-ci.org/jahredhope/base64-image-loader.svg?branch=master)

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