Socket
Socket
Sign inDemoInstall

uploaded-file-saver

Package Overview
Dependencies
4
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    uploaded-file-saver

Saves, updates and deletes uploaded files from hard drive.


Version published
Weekly downloads
5
decreased by-87.18%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

uploaded-file-saver

Saves, updates and deletes uploaded files to and from the hard drive.

Installation:

npm i uploaded-file-saver

Usage:

  • Config once a common containing folder for all files (note that on each save/update/delete you can specify a different folder than this one):
import { fileSaver } from "uploaded-file-saver";
import path from "path";
fileSaver.config(path.join(__dirname, "..", "my-assets", "my-uploaded-files"));
  • Save an uploaded file:
const createdFileName = await fileSaver.add(myUploadedFile);
  • Update existing file with a new uploaded one:
const updatedFileName = await fileSaver.update(existingFileName, newUploadedFile);
  • Delete existing file:
await fileSaver.delete(existingFileName);
  • Get existing file path:
const filePath = fileSaver.getFilePath(existingFileName);
  • Get a cool file-not-found path:
const filePath = fileSaver.getFileNotFoundPath();

Keywords

FAQs

Last updated on 30 Nov 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc