Skip to main content

latest

file storage

Works with
This package works with Deno
JSR Score
64%
Published
2 weeks ago (1.0.2)

A user-friendly file manager

Usage


import { FileManager, FileStore } from "@zyc/file-service"";

async function storeExample() {
	const files = new FileStore(".files");
	const stream = await FileStore.getReadableStreamByFilePath("./1.exe");
	if (stream) console.log(await files.save(stream));
}

async function managerExample() {
	const files = new FileManager(".file-db");
	const stream = await FileStore.getReadableStreamByFilePath("./1.exe");
	if (stream) console.log(await files.add(stream, { name: "1.exe" }));
}

storeExample();

managerExample();

Add Package

deno add @zone/file-service

Import symbol

import * as mod from "@zone/file-service";