@mgalacyber/file-uploader
v1.1.0
Published
File uploader to URL using Universe CDN
Downloads
71
Maintainers
Readme
FILE UPLOADER
This NPM package, file-uploader, is a versatile and efficient solution for handling file uploads in Node.js applications. It provides a seamless and easy-to-use interface to upload files of various types while offering essential features to enhance the overall user experience.
Features
File Expiry:
- Uploaded files are automatically set to expire after 24 hours, ensuring a secure and efficient storage solution. This feature is particularly beneficial for applications that require temporary file storage.
Universal File Support:
- The file-uploader is designed to support all types of files. Whether it's images, documents, audio, or any other file format, the package seamlessly handles the upload process, providing a versatile solution for a wide range of applications.
How It Works
The file-uploader is powered by the Universe CDN, which provides a reliable backend infrastructure for handling file uploads.
Installation
npm:
$ npm install @mgalacyber/file-uploader
yarn:
$ yarn add @mgalacyber/file-uploader
Simple to Use
CommonJs (CJS) syntax
const fileUploader = require("@mgalacyber/file-uploader");
ECMAScript Modules (ESM) syntax
import fileUploader from "@mgalacyber/file-uploader";
Example
const Path = require("path");
const fs = require("fs");
const filePath = Path.join(__dirname, "fileName.extension");
const fileContent = fs.readFileSync(filePath);
fileUploader(fileContent).then((result) => {
console.log(result);
});