# base64-encode-file

> its a image convertor to base64 async

Latest version **1.0.7** (published 2023-06-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install base64-encode-file
pnpm add base64-encode-file
yarn add base64-encode-file
bun add base64-encode-file
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2023-06-12 |
| First published | 2023-05-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | waseem ahmed email:waseemahmed116@gmail.com |
| Maintainers | waseemahmed116 |

## Links

- npm: https://www.npmjs.com/package/base64-encode-file
- Repository: https://github.com/wa5/base64-encode-file
- Homepage: https://github.com/wa5/base64-encode-file#readme
- Issues: https://github.com/wa5/base64-encode-file/issues
- npm.io page: https://npm.io/package/base64-encode-file

## Recent versions

- 1.0.7 (latest) — 2023-06-12
- 1.0.6 — 2023-06-12
- 1.0.5 — 2023-06-08
- 1.0.4 — 2023-06-08
- 1.0.3 — 2023-06-08
- 1.0.2 — 2023-06-08
- 1.0.1 — 2023-06-08
- 1.0.0 — 2023-05-28

## README

# base64-encode-file

# Base64
* Intro: So the Base64 is nothing but conversation of images to ASCII code which is 7-bit character set contains 128 characters.
It can convert the data in human readable format it can encode and decode the base64 languages.

# Step to be follow:
* Install base64-encode-file by using following comand
 ```bash
  npm i base64-encode-file
```
* After the Installation check in the package.json file wither it
is installed or not.
 ```bash
 "base64-encode-file": "^1.0.1",
  ```
* Working Example with React.JS is as follows:
 ```bash
 import logo from './logo.svg';
import './App.css';
import {useState} from 'react'
import base64 from 'base64-encode-file'

function App() {
let [img,setImg]=useState()
let handleChange=async(e)=>{
  let data=await base64(e.target.files[0])
  console.log(data)
}
  return <>
  <h1>testing the  base64-encode-file</h1>
  <input type="file" name="img" onChange={handleChange}/>
  </>
}

export default App;
```
* Working Example with React.TS is as follows:

```bash
import React from 'react';
import logo from './logo.svg';
import './App.css';
import base64 from 'base64-encode-file'

function App() {
 
  let handleChange=async(e:any)=>{
    console.log( await base64(e.target.files[0]))
 
  }
  return (
    <>
    <input type="file" name="" onChange={handleChange} />
    </>
  );
}

export default App;

```

# Base64 code look like this:

* For Example in HTML Coding: ```bash <img src=”data:image/pig: base64, paste the base64 code” alt=””>```
So the code before pasting the base64 code is: ”data:image/pig: base64, and after that you can
paste the base64 code and save and see the result.

# PDF File For Your Reference

* [Conversion PDF Manual](https://github.com/wa5/base64-encode-file/blob/main/Base64.pdf)

# React.js File For Your Reference

* [React.js Example](https://github.com/wa5/base64-encode-file-react-js-example/tree/main/exmple)

# React.ts File For Your Reference

* [React.ts Example](https://github.com/wa5/base64-encode-file-react-js-example/blob/main/flipkart-react/src/App.tsx)

---
_Source: https://npm.io/package/base64-encode-file · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
