|
1 | | -# SniperCode.FileSystem |
| 1 | +# **SniperCode.FileSystem** |
| 2 | + |
| 3 | +[](https://github.com/Sniper-Code/SniperCode.FileSystem/actions/workflows/node.automated.test.yml) |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | +## **Table of Contents** |
| 9 | + |
| 10 | +- [**SniperCode.FileSystem**](#snipercodefilesystem) |
| 11 | + - [**Table of Contents**](#table-of-contents) |
| 12 | + - [**Introduction**](#introduction) |
| 13 | + - [**Installation**](#installation) |
| 14 | + - [**Uninstall**](#uninstall) |
| 15 | + - [**Exposed API**](#exposed-api) |
| 16 | + - [**Network**](#network) |
| 17 | + - [**File**](#file) |
| 18 | + - [**Release**](#release) |
| 19 | + |
| 20 | +## **Introduction** |
| 21 | + |
| 22 | +SniperCode.FileSystem is a file system library for JavaScript providing a simple and easy to use file system API based on [Node.js](https://nodejs.org/en/). It is designed to be used in a Node.js environment and a core part of the JCore Framework. |
| 23 | + |
| 24 | +## **Installation** |
| 25 | + |
| 26 | +To install SniperCode.FileSystem, run the following command: |
| 27 | + |
| 28 | +```bash |
| 29 | + npm install snipercode.filesystem |
| 30 | +``` |
| 31 | + |
| 32 | +## **Uninstall** |
| 33 | + |
| 34 | +To uninstall SniperCode.FileSystem, run `npm uninstall snipercode.filesystem`. |
| 35 | + |
| 36 | +## **Exposed API** |
| 37 | + |
| 38 | +All the exposed API is documented below. |
| 39 | + |
| 40 | +### **Network** |
| 41 | + |
| 42 | +This API is used to access the list of network. Example: |
| 43 | + |
| 44 | +```Node.js |
| 45 | +const {Network} = require('SniperCode.FileSystem'); |
| 46 | +const network = new Network(); |
| 47 | +console.log(network.network); |
| 48 | +/* |
| 49 | +* Prints the list of network in following format. |
| 50 | +* [ '{Device_Name}':'{IP_Address}' ] |
| 51 | +*/ |
| 52 | + |
| 53 | +``` |
| 54 | + |
| 55 | +### **File** |
| 56 | + |
| 57 | +This API is used to access file system and self explanatory endpoints. Example: |
| 58 | + |
| 59 | +```Node.js |
| 60 | + const { |
| 61 | + File_System |
| 62 | + } = require('SniperCode.FileSystem'); |
| 63 | + |
| 64 | + // All the exposed endpoints are static methods of File_System class so you can access them directly. |
| 65 | + |
| 66 | + // Example: |
| 67 | + console.log(File_System.scan_dir('./)) |
| 68 | + // Prints the list of files and directories in the current directory. |
| 69 | +``` |
| 70 | +
|
| 71 | +All the endpoints are listed below. |
| 72 | +
|
| 73 | +1. File_System.path_resolve |
| 74 | +1. File_System.is_file |
| 75 | +1. File_System.file_path |
| 76 | +1. File_System.file_ext |
| 77 | +1. File_System.file_name |
| 78 | +1. File_System.file_name_with_ext |
| 79 | +1. File_System.file_size |
| 80 | +1. File_System.file_exists |
| 81 | +1. File_System.file_stats |
| 82 | +1. File_System.read_file |
| 83 | +1. File_System.write_file |
| 84 | +1. File_System.update_file |
| 85 | +1. File_System.append_file |
| 86 | +1. File_System.delete_file |
| 87 | +1. File_System.rename_file |
| 88 | +1. File_System.copy_file |
| 89 | +1. File_System.move_file |
| 90 | +1. File_System.is_dir |
| 91 | +1. File_System.dir_path |
| 92 | +1. File_System.dir_name |
| 93 | +1. File_System.dir_exists |
| 94 | +1. File_System.scan_dir |
| 95 | +1. File_System.search_dir |
| 96 | +1. File_System.scan_dir_recursive_depth |
| 97 | +1. File_System.scan_dir_recursive |
| 98 | +1. File_System.mkdir |
| 99 | +1. File_System.rename_dir |
| 100 | +1. File_System.copy_dir |
| 101 | +1. File_System.delete_dir |
| 102 | +
|
| 103 | +## **Release** |
| 104 | +
|
| 105 | +Visit [GitHub Release](https://github.com/Sniper-Code/SniperCode.FileSystem/releases) to see the latest release. |
0 commit comments