Socket
Socket
Sign inDemoInstall

fitool

Package Overview
Dependencies
1
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fitool

TypeScript file functions library.


Version published
Weekly downloads
11
decreased by-66.67%
Maintainers
1
Install size
35.6 kB
Created
Weekly downloads
 

Readme

Source

🔧 fitool

TypeScript file functions library.

workflow npm npm NPM

Quickstart:

npm install fitool
# or:
yarn add fitool

Table of contents

  1. Examples
  2. Usage

Examples

Convert text/plain data URL to string

import { download } from 'fitool';

async function example() {
  const result = await toString('data:text/plain,abc');
  // result = abc
}

Download data URL

import { download } from 'fitool';

async function example() {
  await download('data:image/png;base64,...');
}

Usage

toFile(file: File | Blob | string | ArrayBuffer, name?: string): Promise<File>

Converts a given File, Blob, ArrayBuffer, data URL, blob URL or string to a File.

toBlob(file: File | Blob | string | ArrayBuffer): Promise<Blob>

Converts a given File, Blob, ArrayBuffer, data URL, blob URL or string to a Blob.

toDataURL(file: File | Blob | string | ArrayBuffer): Promise<string>

Converts a given File, Blob, ArrayBuffer, data URL, blob URL or string to a data URL.

toBlobURL(file: File | Blob | string | ArrayBuffer): Promise<string>

Converts a given File, Blob, ArrayBuffer, data URL, blob URL or string to a blob URL.

toArrayBuffer(file: File | Blob | string | ArrayBuffer): Promise<ArrayBuffer>

Converts a given File, Blob, ArrayBuffer, data URL, blob URL or string to an ArrayBuffer.

toString(file: File | Blob | string | ArrayBuffer): Promise<string>

Converts a given File, Blob, ArrayBuffer, data URL, blob URL or string to an UTF-8 string.

download(file: File | Blob | string | ArrayBuffer, name: string): Promise<void>

Initiates a download for a given File, Blob, ArrayBuffer, data URL, blob URL or string.

Keywords

FAQs

Last updated on 23 Aug 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc