@mertsolak/file-helper
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

File Helper

Package for file management/conversion/download in javascript/typescript

npm license size issue

Installation

Use node package manager to install @mertsolak/file-helper.

npm i @mertsolak/file-helper

Basic Usage

import { convertBase64ToFile, convertFileToBase64, download } from '@mertsolak/file-helper';

// if base64Data does not include mimeType,
// mimeType has to be provided
const imageInFileFormat = await convertBase64ToFile({
  base64Data: 'data:image/jpeg;base64,...',
  fileName: 'image.jpg',
});
const imageInBase64Format = await convertFileToBase64(imageInFileFormat);

// it can download both format
download(imageInFileFormat);
download(imageInBase64Format);

Readme

Keywords

none

Package Sidebar

Install

npm i @mertsolak/file-helper

Weekly Downloads

8

Version

1.0.0

License

MIT

Unpacked Size

25.8 kB

Total Files

23

Last publish

Collaborators

  • mertsolak