Socket
Socket
Sign inDemoInstall

move-file

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

move-file

Move a file - Even works across devices


Version published
Weekly downloads
324K
increased by2.11%
Maintainers
1
Weekly downloads
 
Created

What is move-file?

The move-file npm package is a utility for moving files and directories with ease. It supports various features such as overwriting existing files, renaming files, and ensuring the destination directory exists.

What are move-file's main functionalities?

Basic File Move

This feature allows you to move a file from one location to another. The code sample demonstrates moving 'source.txt' to 'destination.txt'.

const moveFile = require('move-file');

(async () => {
    await moveFile('source.txt', 'destination.txt');
    console.log('The file has been moved');
})();

Overwrite Existing File

This feature allows you to move a file and overwrite the destination file if it already exists. The code sample demonstrates moving 'source.txt' to 'destination.txt' with the overwrite option enabled.

const moveFile = require('move-file');

(async () => {
    await moveFile('source.txt', 'destination.txt', { overwrite: true });
    console.log('The file has been moved and overwritten');
})();

Ensure Destination Directory Exists

This feature ensures that the destination directory exists before moving the file. If the directory does not exist, it will be created. The code sample demonstrates moving 'source.txt' to a nested directory structure.

const moveFile = require('move-file');

(async () => {
    await moveFile('source.txt', 'non/existent/directory/destination.txt');
    console.log('The file has been moved and the destination directory was created');
})();

Other packages similar to move-file

Keywords

FAQs

Package last updated on 13 Jun 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc