🚀Boost Your Node.js Apps with TeraBox Upload Tool
Supercharge your Node.js applications with the TeraBox Upload Tool — a powerful library for seamless integration with TeraBox, the leading cloud storage platform with 1TB of free space.
✅ Effortlessly:
- Upload, download, retrieve, and delete files
- Manage directories with ease
- Fetch file lists for better organization
Ideal for developers and automation enthusiasts looking for an efficient cloud storage solution in Node.js.
- File Upload: Easily upload files to Terabox storage.
- Custom Directory Support: Specify the directory where the file should be uploaded.
- Progress Tracking: Monitor the upload progress in real-time.
- Retrieve your Files: Retrieve your files from any directory.
- Download your Files: Get direct file download link.
- Delete or move your files from any directory.
- Video Streaming: Support for streaming videos.
- Fetch Upload History
- Fetch Download History
- Restructure code and files
Install the package using npm:
npm install terabox-upload-tool
const TeraboxUploader = require("terabox-upload-tool");
const credentials = {
ndus: "valid_ndus", //Required: Get this from your session (See guide below)
appId: "valid_appId", //Required: Get this from your session (See guide below)
uploadId: "valid_uploadId", //Required: Get this from your session (See guide below)
jsToken: "valid_jsToken", //Required: Get this from your session (See guide below)
browserId: "valid_browserId", //Required: Get this from your session (See guide below)
};
const uploader = new TeraboxUploader(credentials);
To upload a file, use the instance of TeraboxUploader and specify the file path.
async function uploadFile() {
try {
const result = await uploader.uploadFile(
filePath,
showProgress,
"/myUploads"
);
if (result.success) {
console.log("File uploaded successfully!");
console.log("File details:", result.fileDetails);
} else {
console.log("Upload failed:", result.message);
}
} catch (error) {
console.log("An error occurred during the upload:", error.message);
}
}
Fetch the files in a directory
async function fetchFileList() {
try {
const fileList = await uploader.fetchFileList("/myUploads"); //fetching files from 'myuplods' directory, default is '/' directory.
console.log("Files in your directory:", fileList);
} catch (error) {
console.log("Error fetching file list:", error.message);
}
}
Download a file by it's fs_id aka fileId
async function download(fileId) { // fs_id from fetched file information
try {
const res = await uploader.downloadFile(fileId);
console.log(res);
} catch (error) {
console.log(error);
}
}
Delete a list of files, provide an array of path of files to delete
async function deleteList() {
try {
const deleteD = await uploader.deleteFiles([
"/FliqloScr.zip",
"/Consent Letter.docx",
]);
console.log(deleteD);
} catch (error) {
console.error("Error fetching file list:", error.message);
}
}
Moves a file from one location to another with a new name.
async function moveFile(){
try{
const moved = await uploader.moveFiles('/sample_960x540.mkv', '/uploads', 'sample.mkv') //old path, new path, new name
console.log(moved);
}catch(error){
console.log(error);
}
}
We are actively seeking contributors to add the following features:
-
Error Handling Enhancements:
- Improve error messages for easier debugging and user guidance.
-
Automated Tests:
- Add test cases to ensure reliability and robustness.
-
Documentation Updates:
- Expand guides with screenshots and example workflows.
-
Restructure Code and Files:
- Restructure the existing code and files
-
New Features Addition:
- Addition of new features and enhancements
We welcome contributions from the community! Here’s how you can get started:
- Fork the repository and create a new branch for your feature or bugfix.
- Make your changes and ensure the code adheres to the project's style guide.
- Submit a pull request detailing your changes and their purpose.
- Feel free to open issues for feature requests or bug reports.
Terabox Node.js Library
Upload Files to Terabox
Terabox API Integration
Terabox File Management
Node.js Terabox SDK
For getting your credentials, go to the terabox, create an account and follow the steps:
Login you account and open the developer tools
Upload an image from left of your screen
Look for 'appId' and 'uploadId' from following request
Get the 'ndus' from cookies in the header section
This project is licensed under the MIT License.