New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fitool

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fitool

TypeScript file functions library.

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
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

Package last updated on 23 Aug 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