Socket
Book a DemoInstallSign in
Socket

fs-operations

Package Overview
Dependencies
Maintainers
0
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fs-operations

A package for batch file and directory operations

1.3.6
latest
Source
npmnpm
Version published
Weekly downloads
4
-75%
Maintainers
0
Weekly downloads
 
Created
Source

File System Operations

A Node.js package for batch processing of files and directories, supporting rename, delete, move, and copy operations with infinite nesting support.

Features

  • Batch Renaming: Rename files and directories in bulk using regular expressions or fixed rules.
  • Delete Files and Directories: Remove specified files or directories.
  • Move and Copy: Move and copy files and directories.
  • Infinite Nesting Support: Recursively process directories with infinite nesting.
  • Error Handling: Provides clear error messages to help quickly identify issues.

Installation

npm install fs-operations --save-dev

Usage

Rename Files and Directories

import { renameFiles } from "fs-operations";

(async () => {
  await renameFiles("./test", /old/, "new"); // Replace "old" with "new" in filenames and directory names
})();

Delete Files and Directories

import { deleteFiles } from "fs-operations");

(async () => {
  await deleteFiles("./test", /delete/); // Delete files and directories with names containing "delete"
})();

Move Files and Directories

import { moveFiles } from "fs-operations";

(async () => {
  await moveFiles("./test/source", "./test/destination"); // Move a directory
})();

Copy Files and Directories

import { copyFiles } from "fs-operations";

(async () => {
  await copyFiles("./test/source", "./test/copy"); // Copy a directory
})();

Keywords

file

FAQs

Package last updated on 06 Feb 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.