zypher-manager
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

zypher_manager

A library that provides predefined functions for file system operations making file managing easy in javascript.

Installation

To install the library, use npm:

npm install zypher-manager@latest

Now it's easy to manage files using JavaScript with Zypher!

Usage

const manager = require("zypher-manager");
// Create a file
manager.CreateFile("test.js");

// Create a directory
manager.CreateDir("Test");

API

createFile(filepath)

Create a new file with the given file path.

renameFile(oldName,newName)

Rename a file name with the given name.

deleteFile(filepath)

Delete a file with the given file path.

readFileData(filepath)

Reads the data from a given file and return data.

writeData(filepath,data)

Write's Data to a file with the provided name.

createDir(filepath)

Create's a new directory with the given directory name.

deleteDir(filepath)

Deletes a directory with the given directory path.

is_existsFile(filepath)

Checks whether the given file exists or not.

is_existsData(filepath,data)

Checks whether the given target data exists in the given file or not.

is_existsDir(directorypath)

Checks if a directory with the given directory name exists or not.

insertDataAtEnd(filepath,data)

Appends data at the end of the the given file.

insertDataAtStart(filepath,data)

Appends data at the start of the the given file.

renameDir(oldPath,newPath)

Renames the given directory path with the given new path.

moveFile(sourcePath,destinationPath)

Moves a file to a new given location.

copyFile(sourcePath,destinationPath)

Copy the file to the given destination file.

copyDirectory(source,destination)

Copy the directory to the given destination.

copyFileToDirectory(sourcePath,destinationPath)

Copy the file to the given destination.

searchFileInDirectory(directoryPath,fileName)

Searches for a file in the specified directory.

createFiles(fileNames)

Creates all the files from a given array of files of path type.

getFileStats(filePath,sizeUnit)

Creates all the files from a given array of files of path type.

convertFileSize(sizeInBytes,unit)

Converts the given number of bytes to a specified format.

isValidSizeUnit(unit)

Checks whether the given string is a valid file format string and returns true if it is valid otherwise false.

License

This project is licensed under the MIT License.

Package Sidebar

Install

npm i zypher-manager

Weekly Downloads

6

Version

0.0.8

License

MIT

Unpacked Size

55.4 kB

Total Files

8

Last publish

Collaborators

  • ibrahimkhan