sazumifile

1.0.2 • Public • Published

upload-file Module

This module allows you to easily upload files to an external server using Node.js. The module utilizes Axios, FormData, and fs libraries to perform file uploads.

Installation

To use this module, you need to install it via npm.

npm install sazumifile

Usage

Here's how to use the module in a Node.js application:

Import the uploadFile module:

const { uploadFile } = require('sazumifile');

Call the uploadFile function with the path to the file you want to upload:

const filePath = 'path/to/your/file.txt';

uploadFile(filePath)
  .then((url) => {
    console.log(`File uploaded successfully. URL: ${url}`);
  })
  .catch((error) => {
    console.error(`Failed to upload file: ${error.message}`);
  });

Make sure to replace 'path/to/your/file.txt' with the actual path to the file you want to upload.

Readme

Keywords

none

Package Sidebar

Install

npm i sazumifile

Weekly Downloads

4

Version

1.0.2

License

ISC

Unpacked Size

2.16 kB

Total Files

3

Last publish

Collaborators

  • makemeow