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

@mamodesaebsaad/image-to-base64

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mamodesaebsaad/image-to-base64 - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

7

lib/index.js

@@ -16,2 +16,5 @@ /**

}
else if (file.type === "gif") {
base64String = base64String.replace("data:image/gif;base64,", "");
}
else {

@@ -36,2 +39,3 @@ base64String = base64String.replace(/^data:image\/(png|jpg|jpeg|webp);base64,/, "");

let svgfileType = "data:image/svg+xml;base64,";
let gifFileType = "data:image/gif;base64,";
let image = "";

@@ -41,2 +45,5 @@ if (file === "svg") {

}
else if (file === "gif") {
image = gifFileType + base64String;
}
else {

@@ -43,0 +50,0 @@ image = imageFiletype + base64String;

2

package.json
{
"name": "@mamodesaebsaad/image-to-base64",
"version": "1.0.1",
"version": "1.0.2",
"description": "Conversion of image to base64 and vice-versa",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

### Image To base64 convertor
This package convert images of type png, jpg, jpeg and svg to base64 and vice versa (converts base64 to image format)
This package convert images of type png, jpg, jpeg, svg and gif to base64 and vice versa (converts base64 to image format)

@@ -4,0 +4,0 @@ ### Instructions

@@ -17,2 +17,5 @@

}
else if (file.type === "gif"){
base64String = base64String.replace("data:image/gif;base64,", "");
}
else {

@@ -39,2 +42,3 @@ base64String = base64String.replace(/^data:image\/(png|jpg|jpeg|webp);base64,/, "");

let svgfileType = "data:image/svg+xml;base64,";
let gifFileType = "data:image/gif;base64,";
let image = "";

@@ -44,2 +48,5 @@ if(file === "svg"){

}
else if(file === "gif"){
image = gifFileType + base64String;
}
else{

@@ -46,0 +53,0 @@ image = imageFiletype + base64String;

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