1.1.1 • Published 5 months ago

fileasy v1.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

media

fileasy

documantation

fileasy.rucuru.com

conversion

const base64ToFile: (base64: string, fileName?: string, type?: string) => File
const binaryToString: (data: ArrayBuffer | File) => Promise<string>
const fileToArrayBuffer: (file: File) => Promise<ArrayBuffer>
const fileToBase64: (file: File) => Promise<string>
// path: base64 | dataDUI | URL
const fileToHTMLImageElement: (path: string) => Promise<HTMLImageElement>
const svgToJpeg: (svgData: string | File, name?: string, fillStyle?: string) => Promise<File>
const jpegToPng: (svgData: string | File, name?: string) => Promise<File>
const pngToJpeg: (svgData: string | File, name?: string, fillStyle?: string) => Promise<File>
const svgToPng: (svgData: string | File, name?: string) => Promise<File>
const pdfToPng: (pdfFile: File, pageNum?: number) => Promise<File[]>
const pngToHex: (buffer: Buffer) => Promise<PngToHex>
const videoToPng: (videoFile: File, currentTime?: number, secLimit?: number) => Promise<string>

Warninghttps://fileasy.rucuru.com/convert/pngToHex.html

get

const getInfoFromFile: (file: File) => Promise<GetInfoFromFile>
const getMimeTypeFromBuffer: (data: Buffer) => string

Warninghttps://fileasy.rucuru.com/get/getMimeTypeFromBuffer.html

const getDataFromByte: (size: number) => {formatNum: number; unit: string; full: string;}
const getTypeFromDataURI: (base64: string) => string

other

const downloadToDevice: (fileData?: GetInfoFromFile | File, name?: string) => void
function downloadFromURL(url: string, type: string, name: string, fun?: ((rogress: number) => void) | undefined): Promise<File>
const selectFile: (accept?: string, maxLen?: number) => Promise<File[] | undefined>

types

type GetInfoFromFile = {
	file: File,
	path: string,
	type: string,
	name: string,
	size: number,
	stringBytes: string,
	width: number,
	height: number,
	base64: string,
	extension: string,
}

export type GetInfoFromFile = {
	file: File
	path: string
	type: string
	name: string
	size: number
	stringBytes: string
	width: number
	height: number
	base64: string
	extension: string
}

type GetMimeTypeFromBuffer =
	| 'image/png'
	| 'image/jpeg'
	| 'image/gif'
	| 'image/tiff'
	| 'image/webp'
	| 'image/svg+xml'
	| 'application/pdf'
	| 'application/msword'
	| 'video/mp4'
	| 'audio/mpeg'
	| 'application/octet-stream'

type PngToHex = {
	width: number
	height: number
	depth: number
	color: number
	compress: number
	filter: number
	interlac: number
	data: string[]
}
1.1.1

5 months ago

1.1.0

5 months ago

1.0.1

11 months ago

1.0.0

1 year ago

1.0.0-alpha.1

1 year ago

1.0.0-alpha.0

1 year ago

0.2.8

1 year ago

0.2.7

1 year ago

0.2.6

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.3

1 year ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.1.0-beta.3

2 years ago

0.1.0-beta.2

2 years ago

0.1.0-beta.1

2 years ago