Skip to content

Commit 6ca1eb2

Browse files
committed
Filesystem Implemented
1 parent ee3096c commit 6ca1eb2

File tree

14 files changed

+14040
-1
lines changed

14 files changed

+14040
-1
lines changed

.babelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": [
3+
"@babel/preset-env"
4+
]
5+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Automated Test File System
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
strategy:
12+
matrix:
13+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
14+
node-version: [16]
15+
# os: [windows-latest]
16+
os: [ubuntu-latest, windows-latest, macos-latest]
17+
runs-on: ${{ matrix.os }}
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Node.js Setup ${{ matrix.node-version }}
21+
uses: actions/setup-node@v2
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: "npm"
25+
- run: npm ci
26+
- run: npm test

.gitignore

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage
23+
*.lcov
24+
25+
# nyc test coverage
26+
.nyc_output
27+
28+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29+
.grunt
30+
31+
# Bower dependency directory (https://bower.io/)
32+
bower_components
33+
34+
# node-waf configuration
35+
.lock-wscript
36+
37+
# Compiled binary addons (https://nodejs.org/api/addons.html)
38+
build/Release
39+
40+
# Dependency directories
41+
node_modules/
42+
jspm_packages/
43+
44+
# TypeScript v1 declaration files
45+
typings/
46+
47+
# TypeScript cache
48+
*.tsbuildinfo
49+
50+
# Optional npm cache directory
51+
.npm
52+
53+
# Optional eslint cache
54+
.eslintcache
55+
56+
# Microbundle cache
57+
.rpt2_cache/
58+
.rts2_cache_cjs/
59+
.rts2_cache_es/
60+
.rts2_cache_umd/
61+
62+
# Optional REPL history
63+
.node_repl_history
64+
65+
# Output of 'npm pack'
66+
*.tgz
67+
68+
# Yarn Integrity file
69+
.yarn-integrity
70+
71+
# dotenv environment variables file
72+
.env
73+
.env.test
74+
75+
# parcel-bundler cache (https://parceljs.org/)
76+
.cache
77+
78+
# Next.js build output
79+
.next
80+
81+
# Nuxt.js build / generate output
82+
.nuxt
83+
dist
84+
85+
# Gatsby files
86+
.cache/
87+
# Comment in the public line in if your project uses Gatsby and *not* Next.js
88+
# https://nextjs.org/blog/next-9-1#public-directory-support
89+
# public
90+
91+
# vuepress build output
92+
.vuepress/dist
93+
94+
# Serverless directories
95+
.serverless/
96+
97+
# FuseBox cache
98+
.fusebox/
99+
100+
# DynamoDB Local files
101+
.dynamodb/
102+
103+
# TernJS port file
104+
.tern-port

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"cSpell.words": [
3+
"snipercode"
4+
]
5+
}

README.md

Lines changed: 105 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,105 @@
1-
# SniperCode.FileSystem
1+
# **SniperCode.FileSystem**
2+
3+
[![Automated Test File System](https://github.com/Sniper-Code/SniperCode.FileSystem/actions/workflows/node.automated.test.yml/badge.svg?branch=main)](https://github.com/Sniper-Code/SniperCode.FileSystem/actions/workflows/node.automated.test.yml)
4+
![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/Sniper-Code/SniperCode.FileSystem)
5+
![GitHub last commit](https://img.shields.io/github/last-commit/Sniper-Code/SniperCode.FileSystem)
6+
![GitHub](https://img.shields.io/github/license/Sniper-Code/SniperCode.FileSystem)![GitHub top language](https://img.shields.io/github/languages/top/Sniper-Code/SniperCode.FileSystem)
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.

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports =
2+
{
3+
Network: require('./src/network'),
4+
File_System: require('./src/fs'),
5+
}

0 commit comments

Comments
 (0)