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

Conversion of image to base64 and vice-versa

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Image To base64 convertor

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

Instructions

  • To install this package npm install @mamodesaebsaad/image-to-base64

  • Then in your file import the module

    import { convertImageToBase64, convertBase64ToImage } from 'image-to-base64';
    
  • To convert image to base64

        const file = e.target.files[0];
        convertImageToBase64(file)
        .then((base64String) => {
            console.log(base64String);  
        })
        .catch((error) => console.error(error));
    
  • To convert Base64 to image format

        convertBase64ToImage(base64String, filename)
        .then((file) => {
            console.log(file);
        })
      .catch((error) => console.error(error));
    

Keywords

FAQs

Package last updated on 23 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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