A file splitting & merging solution.
For JavaScript/TypeScript environment:
# npm
npm i @filego/js
# Yarn
yarn add @filego/js
# pnpm
pnpm add @filego/js
# Deno
deno add npm:@filego/js
# Bun
bun add @filego/js
For Node.js, Deno, and Bun runtime environment:
# npm
npm i @filego/node
# Yarn
yarn add @filego/node
# pnpm
pnpm add @filego/node
# Deno
deno add npm:@filego/node
# Bun
bun add @filego/node
Easily split a file into chunks using the split function from @filego/js
, or work directly with the file system using @filego/node
.
import { split } from "@filego/js";
const file: File | Blob | Uint8Array | string = "";
await split({
file,
chunkSize: 2 * 1024 * 1024,
});
import { split } from "@filego/node";
await split({
inFile: "/path/to/file.txt",
outDir: "/path/to/dir",
chunkSize: 2 * 1024 * 1024,
});
For the JS package APIs, please refer to the JS APIs.
For the Node package APIs, please refer to the Node APIs.
Check out the Web and API examples:
For the example of web in React, please refer to examples/web.
For the example of Node in Hono, please refer to examples/node.
This project is licensed under the terms of the MIT license.